Re: String to real conversion question
Re: String to real conversion question
- Subject: Re: String to real conversion question
- From: Michelle Steiner <email@hidden>
- Date: Sun, 2 May 2010 09:06:34 -0700
On May 2, 2010, at 8:59 AM, Bob Studer wrote: set x to "0.25" -- string --set x to x as number -- z still outputs 100 --set x to x as real -- z still outputs 100 set y to "4" -- string set z to x * y -- how can I output z = 1 here, instead of z = 100?
I would hazard a guess that this has to do with how the string is interpreted because the original poster is from the Netherlands (at least his TLD indicates so) and so probably has the locale set for there. He could try using "0,25"
Bingo! When I changed "0.25" to "0,25" in my US system, I get 100 as the result.
set x to "0,25" x as number --> 25
-- Michelle --
People aren't furniture (ok, sometimes they are but that's consensual ....) -- erin oneill
|
_______________________________________________
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