Hello.
The three iWork applications behave the same so I will describe the 'problem' for Numbers.
Open a blank spreadsheet then run this simple script.
--[SCRIPT]
set aReal to 1 / 2
tell application "Numbers" to tell document 1 to tell sheet 1 to tell table 1
set value of cell "C3" to aReal
set value of cell "D3" to "= C3 * 2"
set value of cell "C4" to aReal as text
set value of cell "D4" to "= C4 * 2"
end tell
--[/SCRIPT]
On a system using the period as decimal delimiter,
you will get the value 0.5 in cells C3 and D3 and the value 1 in cells D3 and D4.
You are lucky guys.
On systems using the comma as decimal delimiter,
we get 0.5 (yes a period) in C3, the infamous red triangle in cell D3, 0,5 (yes, a comma) in cell C4 and 1 in cell D4.
The red triangle is a logical result because the app is unable to apply the multiplication operator to the value 0.5
As AppleWorks behave this way since the delivery of AppleScript, I was not really surprised when I discovered that Numbers behave this way.
But, yesterdays I was said that this behaviour must be seen as a Numbers bug.
Apps are supposed to be able to deal by themselves with the real numbers issued by AppleScript (which uses always the decimal period).
I wish to know your advice.
Is it a bug or is it a feature ?
Of course, no need to explain that when it coerce a real to a text object,
AppleScript uses the local decimal delimiter
so that the 'English' real 0.5 becomes the 'French' string "0,5"
which is deciphered by tNumbers as the 'French' real 0,5
Thanks in advance.
Yvan KOENIG (VALLAURIS, France) mardi 8 juin 2010 10:40:00