Code: Select all
on mouseUp
put 1.2345678 into temp
answer the length of temp
set the numberFormat to "0.##"
put temp * 1 into temp ----Rounds to 1.234568
-- side issue follows
answer the length of temp
answer the length of temp && char 6 of temp
end mouseUp
As a side issue (this based on something Colin posted on the use-group) the numberFormat property should only affect the number of chars displayed. In HC, if I step through the above, the numberFormat truncs the value to two decimal places immediately. In LC, it does nothing (except for that rounding thing). Isn't there a disconnect between the value shown in the debugger (eight chars, never mind it should be 9) and the value you get when you try to do anything with that value, such as execute that last line, or place the variable into a field. By disconnect, I mean "when is that value really truncated? Or rather, why is it not truncated as shown in the debugger?
Craig Newman