Negative Numbers and NumberFormat

Paul Dupuis paul at researchware.com
Thu Apr 6 13:50:56 EDT 2017


I am curious why folks use numberFormat vs the format function (which is
much more consistent and versatile). Is the issue the complexity of the
formatting strings for the format function?

put format("$%0.2f",tMoney) into msg

for tMoney = 5.55, you get $5.55
for tMoney = 5.33333, you get $5.33

want a space between the $, then use
put format("$ %0.2f",tMoney) into msg

want a leading zero and minimum of 2 digits before the decimal point
put format("$ %05.2f",5.553) into msg

I concur with Richards comment from Mark - it just seems like a low
value and high risk work to change numberFormat at this point. I would
think people should consider it deprecated in favor of format.




More information about the use-livecode mailing list