Re: Coercing Numbers
Re: Coercing Numbers
- Subject: Re: Coercing Numbers
- From: Stan Cleveland <email@hidden>
- Date: Fri, 26 Feb 2010 12:54:19 -0800
- Thread-topic: Coercing Numbers
On 2/26/10 12:01 PM, "Oakley Masten" wrote:
> set x to 124.95 * 100
> --> x = 1.2495E+4
>
> How do I get this to show up as 12495 ?
If you can live without a numeric result, there's this odd trick (discovered
by Shane Stanley, I believe) that will return larger numbers as strings:
set x to 124.95 * 100 as meters as text
--> x = "12495"
set x to 1.23456789123E+10 as meters as text
--> x = "12345678912.3"
set x to 1.23456789012345E+12 as meters as text
--> x = "1234567890123.45"
set x to 1.23456789012345E+15 as meters as text
--> x = "1234567890123450"
This method seems to top out around 15 or 16 digits before reverting back to
scientific notation, but that's based on just my casual observation.
Apparently, most any unit (gallons, miles, etc.) will work, not just meters.
HTH,
Stan C.
_______________________________________________
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