• 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: Simple multiplication going bizarre
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple multiplication going bizarre


  • Subject: Re: Simple multiplication going bizarre
  • From: Doug Tallman <email@hidden>
  • Date: Sat, 1 May 2010 17:35:55 -0400

When I multiply two large numbers, no decimals, I still get a large number. Add a decimal, even just a tenth, it slips into scientific notation.

But this seems to work (but only if you have two decimal places max):

set firstPart to (16477.1 * 1057.5 div 1) as string
set secondPart to (16447.1 * 1057.5 mod 1) * 100 div 1

set completeNumber to (firstPart & "." & secondPart)

Curiously, enter "16477.1" and AppleScript Editor changes it to 1.64771E+4.


doug

 _______________________________________________
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

  • Prev by Date: How can I speed up creation of events in iCal?
  • Next by Date: Re: Simple multiplication going bizarre
  • Previous by thread: How can I speed up creation of events in iCal?
  • Next by thread: Re: Simple multiplication going bizarre
  • Index(es):
    • Date
    • Thread