Saturday, June 8, 2019

Numbers cannot be correctly converted to strings by tostring command

Any help would be appreciated. I had a serious problem that numbers cannot be correctly converted to strings by tostring command.

The command is as follow:
Code:
set obs 1
gen a=12345.05
tostring a, gen(a1)
stata shows "a cannot be converted reversibly; no generate"
if I use command :
Code:
tostring a, gen(a1) force
The generated a1 equals 12345.0498, which is different from a.

Thank you very much for your concern and sincerely hope to get anyone's help.
Best wishes.


No comments:

Post a Comment