04-12-2013 12:15 PM
I was creating a statistical report and wanted to have a p-value with 3 digits.
I got p=0.0501, but if I rounded it to 0.001 then I would have a p=0.05. How can I keep the last zero?
I used compress or compbl to make it into a string, but they did not work.
04-12-2013 12:28 PM
@data_null and @ballardw, thanks for the quick reply!
Just one more question. If I want to put "0.050" in a string, for example I may try to use "call symput" to make a &pvalue=0.050, then how can I do?
04-12-2013 12:24 PM
For most purposes assigning a format with the appropriate number of decimal points will display as you want. I would suggest an f5.3. The internal storage of the value doesn't change just the display.
x = 0.05;
put x f6.3;