Round off floating point numbers to the nearest ten. Does not work with integers
on roundOff num
tempFP = the floatPrecision
numString = string(num)
--put "original number:"&&numString
repeat with i = 0 to tempFP
tot = numString.char.count
--put "deleting char:"&&numString.char[tot]
delete char tot of numString
end repeat
tot = numString.char.count
dependent = numString.char[tot]
--put "dependent is:"&&dependent
dependent = integer(dependent)
if dependent>=5 then
dif = 10-dependent
myNum = integer(numString)+dif
else
myNum = integer(numString)-dependent
end if
return myNum
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA