Re: Limiting Decimal Places in a Floating Variable?
Re: Limiting Decimal Places in a Floating Variable?
- Subject: Re: Limiting Decimal Places in a Floating Variable?
- From: Michelle Steiner <email@hidden>
- Date: Wed, 22 Nov 2000 09:45:46 -0800
On 11/22/00 8:57 AM, Marc K. Myers <email@hidden> wrote
>
The other is to use the "round" function on the result:
>
>
set theTotal to (round(theTotal * 100)) / 100
>
>
This would change -2134.2399999 to -2134.24, which, you say, is not the
>
value you expected.
but
set theTotal to (round(theTotal * 100)) / 100 rounding toward zero
does return the expected value, even for negative numbers.
The options for rounding are up, down, toward zero, and nearest (which is
the default)
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | Hard as it may be to believe, my |
| email@hidden | life has been based on a true story. |
----------------------------------------------------------------------