Math problems?

Mark Wieder mwieder at ahsoftware.net
Sat May 20 15:09:47 EDT 2006


Peter-

Friday, May 19, 2006, 12:04:55 PM, you wrote:

> I am doing the following:

> put 10.27 into tNumber
> put the trunc of tNumber into tInteger
> put tNumber - tInteger into tDecimal
> put 100 * tDecimal into tNew Decimal
> put the trunc of tNewDecimal

> and I get 26 instead of 27.

  put trunc(tNewDecimal & "")

forcing it into a string does the trick. Better yet,

function truncate pValue
  return trunc(pValue & "")
end truncate

Note: this is BZ #2419, which for some reason Tuviah closed as
NOT_A_BUG in January 2004, so unless Jacque reopens it it's unlikely
that it will be fixed.

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the use-livecode mailing list