• 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: Number Format Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Number Format Problem


  • Subject: Re: Number Format Problem
  • From: Paul Berkowitz <email@hidden>
  • Date: Fri, 21 Mar 2008 12:40:15 -0700
  • Thread-topic: Number Format Problem

Title: Re: Number Format Problem
On 3/21/08 12:31 PM, "Michelle Steiner" <email@hidden> wrote:

On Mar 21, 2008, at 12:29 PM, John Mistler wrote:
I'm trying to convert a string to a number, so that I can use it in an arithmetic function, but there is a problem:

set theAmount to "12345.00"
set theAmount to theAmount as number
log theAmount --> 1.2346E+4

How can I prevent the number from converting to this format?

 
If you're going to use it in an arithmetic function, what difference does it make how it is displayed?

-- Michelle

If there is some reason, you can do it 'as integer' instead of 'as number' to get it into 12345 format, but not 12345.00. And it only works up to 536870911 (2^29 - 1), the limit for integer in AppleScript.


--
Paul Berkowitz
 _______________________________________________
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: 
 >Re: Number Format Problem (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: mounting volumes
  • Next by Date: Re: Number Format Problem
  • Previous by thread: Re: Number Format Problem
  • Next by thread: reading a file in an applescript.
  • Index(es):
    • Date
    • Thread