• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Round à number to 0, 10, 20, 30 etc...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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. |
----------------------------------------------------------------------


  • Prev by Date: Re: desktop printing
  • Next by Date: Mounting Volume
  • Previous by thread: Re: Excel scripting question
  • Next by thread: Mounting Volume
  • Index(es):
    • Date
    • Thread