> But I cavalierly thought that trunc would work too. It does not. Even > though the docs say that trunc returns an integer, it does not when the > numberFormat is in play: > > on mouseUp > set numberformat to "#.00" > put 1 into y > add 0 to y > answer trunc(y) -- yields "1.00" > end mouseUp > > Neither does the "round" function.
It seems that the numberFormat is taking precedence here. If you try this in the message box: put trunc(1.00) or put round(1.00) you will get 1 as expected, but in your sample, the y is being truncated, then the 2 decimal places are being re-applied for the answer. You can check that this is what is happening by setting y to something like 1.23, which makes your "answer" display 1.00 As a general rule, I much prefer using the format function to the numberFormat. I feel that I have more control that way, since it is only applied to numbers that I want to apply it to, instead of all numbers which is what causes problems like the one with the field reference. Cheers, Sarah _______________________________________________ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution