Re: Round à number to 0, 10, 20, 30 etc...
Re: Round à number to 0, 10, 20, 30 etc...
- Subject: Re: Round à number to 0, 10, 20, 30 etc...
- From: Michelle Steiner <email@hidden>
- Date: Sun, 8 Apr 2001 17:30:27 -0700
On 4/8/01 2:54 PM, giZm0 <email@hidden> wrote:
>
Hi, I am looking for a way to round a number (between 1 and 100) to its
>
3about ten2 (0, 10, 20, 30 etc..).
>
>
I tried several times with the 3round command2 but I just cant get it
>
right....
>
>
Can someone help me ?
>
Currently my script goes like this :
>
set curvol to (round (value/ 10)) * 10
Assuming that you want to round up or down to the nearest multiple of
ten, try this:
set curvol to ((aNumber + 5) div 10) * 10
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------