formatting data in a field

DunbarX at aol.com DunbarX at aol.com
Mon Apr 5 11:29:43 CDT 2010


Dave, I think what was not made strongly enough in all the posts was that 
at least one numerical operation has to be performed for the numberformat to 
lock in. So:

get "1.234"
set numberformat to "0.0"
put it

will give you "1.234"

In the responses, you may have seen the variable multiplied by 1, which may 
have seemed superfluous. It is not. Personally, I like to add 0. But you 
have to do something.

get "1.234"
set numberformat to "0.0"
add 0 to it
put it

gives you "1.2"

Craig Newman



More information about the use-livecode mailing list