Re: is it normal ?
Re: is it normal ?
- Subject: Re: is it normal ?
- From: Thomas Fischer <email@hidden>
- Date: Tue, 08 Oct 2013 09:09:57 +0200
Hello,
I don't see it as a bug, only a limitation in the conversion/coercion that the "as text" provides: it seems to change only pure numbers and no combined expressions or strings.
E.g.:
set test to 4999.0 * 12.5
--> 6.24875E+4
set test to 4999.0 * 12.5 as meters
--> meters 6.24875E+4
set test to 4999.0 * 12.5 as text
--> 6,24875E+4
set test to 4999.0 * 12.5 as meters as text
--> 62487.5
And funnily, although the last result looks like a number, it isn't:
set test to ((4999.0 * 12.5 as meters as text) as number)
--> 624875
It seems that numbers are always expected with a decimal point (2,5 is not allowed), and only in numbers the decimal point is change to a comma.
"2,5" as number
--> 2.5
while
"2.5" as number
--> 25
Best
Thomas
Am 07.10.2013 um 23:52 schrieb Shane Stanley:
> On 8 Oct 2013, at 2:33 AM, koenig.yvan <email@hidden> wrote:
>
>> As I am accustomed to see AppleScript returning numerical values according to the local format, I assumed that running it on my system (working in french) I would get "62487,5" but I was wrong.
>> On a French system the result is also the English version "62487.5"
>>
>> Is it the designed behaviour ?
>
> Maybe it's a small protest at the spelling of metres ;-)
>
> It looks like a bug to me. But then the "as text" coercion has always behaved differently with units, which is why it's been used as a workaround to avoid scientific formatting.
>
> --
> Shane Stanley <email@hidden>
> 'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>
>
>
> _______________________________________________
> 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
_______________________________________________
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