• 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: Rounding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rounding


  • Subject: Re: Rounding
  • From: Doug McNutt <email@hidden>
  • Date: Tue, 19 Mar 2002 19:32:08 -0700

At 20:47 -0500 3/19/02, Rob Jorgensen wrote:
>So, how do I round 14 to 15, or 16 to 20? Does anyone care to share a handler which addresses this?

In general that kind of rounding consists of:

1) divide by 5
2) add 0.5 (if you want to get nearest rather than lower)
3) take the integer part of the result
4) multiply by 5

I doubt that the "natural language" of AppleScript will do that without complaining a few times though.

--
--> If you are presented a number as a percentage, and you do not clearly understand the numerator and the denominator involved, you are surely being lied to. <--
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Rounding (From: Rob Jorgensen <email@hidden>)

  • Prev by Date: Re: AppleScript CGI Limitations
  • Next by Date: Re: AppleScript CGI Limitations
  • Previous by thread: Rounding
  • Next by thread: Re: Rounding
  • Index(es):
    • Date
    • Thread