• 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: How can I round in applescript to 3 digits after a period?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I round in applescript to 3 digits after a period?


  • Subject: Re: How can I round in applescript to 3 digits after a period?
  • From: Michaël Grünewald <email@hidden>
  • Date: Thu, 3 Jan 2008 11:45:39 +0100


Le 3 janv. 08 à 11:34, Patrik B. a écrit :

Hi,

This might sound silly but how do you round a real number in applescript to 3
digits after the period?


I.e. 19.9898923978923892 should just be rounded to 19.989
Also 19.0909 should just be rounded to 19.989

Per what I understand rounding in applescript rounds to an integer so is there
a different rounding method that I can use to round to three digits after the
period?


I donot know if there is a special provision to round to a fixed position in Applescript, but you may try the following:

--- multiply your number by 1000
--- round it as an integer
--- divide it by 1000

I hope this helps, but this might be far from the better way to do!
--
\bye
Micha






___________________________________________________________________________ Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire. http://fr.mail.yahoo.com _______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >How can I round in applescript to 3 digits after a period? (From: "Patrik B." <email@hidden>)

  • Prev by Date: Re: How can I round in applescript to 3 digits after a period?
  • Next by Date: Fwd: Dates
  • Previous by thread: Re: How can I round in applescript to 3 digits after a period?
  • Next by thread: Re: How can I round in applescript to 3 digits after a period?
  • Index(es):
    • Date
    • Thread