.
Why does the float function not work like this? I feel silly.
clear
input float x
0.00
0.01
0.03
0.10
0.30
1.00
end
generate str4 x_str = ""
replace x_str = "0.00" if float(x) == 0.0
replace x_str = "0.01" if float(x) == 0.01
replace x_str = "0.03" if float(x) == 0.03
replace x_str = "0.10" if float(x) == 0.1
replace x_str = "0.30" if float(x) == 0.3
replace x_str = "1.00" if float(x) == 1.0
list, clean
which gave
. list, clean
x x_str
1. 0 0.00
2. .01
3. .03
4. .1
5. .3
6. 1 1.00
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/