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

Re: Coercing Numbers


  • Subject: Re: Coercing Numbers
  • From: Michelle Steiner <email@hidden>
  • Date: Fri, 26 Feb 2010 13:33:19 -0700


On Feb 26, 2010, at 1:01 PM, Oakley Masten wrote:

I can't find the answer to this and don't know where else to look.



set x to 24.95 * 100
-->  x = 2495.0

set x to 124.95 * 100
-->   x = 1.2495E+4

set x to 124.95 * 100 as integer

This works, though, only when the result of the multiplication is an integer.  For instance, this returns a false result:

set x to 124.956 * 100 as integer

The correct answer is 12495.6, but the script returns 12396.

-- Michelle

--
"I'll do the best I can do because that's the best I can do!"

 _______________________________________________
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

  • Follow-Ups:
    • Re: Coercing Numbers
      • From: "Stockly, Ed" <email@hidden>
References: 
 >Coercing Numbers (From: Oakley Masten <email@hidden>)

  • Prev by Date: Re: Coercing Numbers
  • Next by Date: Re: Coercing Numbers
  • Previous by thread: Re: Coercing Numbers
  • Next by thread: Re: Coercing Numbers
  • Index(es):
    • Date
    • Thread