formatting data in a field

David Coker davidocoker at gmail.com
Mon Apr 5 13:07:57 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"

Thank you Craig,
Out of all the small apps I've built with Rev so far, this is the
first time I've ever had the need to to format a number and in this
case it's purely to enhance what the user will see. It's all good info
and I appreciate all of the tips and suggestions because I'm sure that
I (or someone else) will need the knowledge down the road somewhere.

Best regards,
David C.



More information about the use-livecode mailing list