MOD function does not work! So be warned!

Dar Scott dsc at swcp.com
Fri Mar 29 02:47:02 EST 2002


On Thursday, March 28, 2002, at 11:04 PM, David Vaughan wrote:

> No worries and it was worth a chuckle. Actually, I did indeed copy 
> your code into the message box exactly as you had it, got false, 
> then experimentally typed in
>  "put .8 + .2 = 10"
>  and finally noticed just before I hit the enter key...  ;-)

Here is a better example:

on mouseUp
   put "235.00" into var
   repeat for 100 times
     put var + "0.01" into var
   end repeat
   Put var && (var = "236.00") into field "Report"
end mouseUp

This puts "236 false" into the field.

This works as hoped (for cent arithmetic):

on mouseUp
   put "235.00" into var
   repeat for 100 times
     put round(var + "0.01",2) into var
   end repeat
   Put var && (var = "236.00") into field "Report"
end mouseUp

Dar




More information about the use-livecode mailing list