• 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 to decimal place
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rounding to decimal place


  • Subject: Re: rounding to decimal place
  • From: Wayne Melrose <email@hidden>
  • Date: Sun, 9 Oct 2005 10:04:36 +0200

On Oct 9, 2005, at 9:53 PM, Gary (Lists) wrote:


Here is Nigel Garvey's rounding handler, which I've used for years,

without ever worrying about it.



roundThis(75.5436, 2) --> 75.54


on roundThis(n, numDecimals)

    set x to 10 ^ numDecimals

    (((n * x) + 0.5) div 1) / x

end roundThis 




Yes actually this is the one that I have ended up using.. ;) very tidy.

Thanks also to Doug McNutt!

Wayne
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: rounding to decimal place (From: "Gary (Lists)" <email@hidden>)

  • Prev by Date: Using makePDF
  • Next by Date: Re: Paths & quoted form & do shell script
  • Previous by thread: Re: rounding to decimal place
  • Next by thread: Re: rounding to decimal place
  • Index(es):
    • Date
    • Thread