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

Rounding numbers in Applescript


  • Subject: Rounding numbers in Applescript
  • From: PiercyWorld <email@hidden>
  • Date: Thu, 8 Jul 2004 12:52:16 -0700

Hi, I was wondering what the code would be to get a number to round to
10.25 when the number is 10.2499999999999

I am having image Events get the height and width of a file but it
sometimes returns a long number. All I wan is the first 2 before the
decimal and the second 2 after the decimal.

Here is what I have so far.

set image_height to round (image_height / image_DPI) rounding up as text

this will only return the first 2 numbers. So, the above number gets
returned as 10 instead of 10.25.

Thanks in advance!!!

Vic Piercy
_______________________________________________
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.


  • Follow-Ups:
    • Re: Rounding numbers in Applescript
      • From: Graff <email@hidden>
  • Prev by Date: Re: SOAP XML
  • Next by Date: Changing screen resolutions - updated
  • Previous by thread: Re: Mail.app and print from rules
  • Next by thread: Re: Rounding numbers in Applescript
  • Index(es):
    • Date
    • Thread