Decimal Separator

Rob Cozens rcozens at pon.net
Sun Dec 14 09:02:04 EST 2003


>I'm working on the problem to know the decimal separator defined in 
>the system, on MacOS X and W2K.

Hi Thierry,

While one can use "system date" syntax to find the date separator and 
order of the month, day, & year elements, I have found no way to 
determine the Control Panel settings for decimal & thousands 
separators and the currency symbol via Transcript.

Lacking "system numberFormat" syntax, I created my own solution:  All 
number formatting handlers in Serendipity Library look for a 
numberEditMask property in the calling stack.  If the property is 
empty, the Library displays a modal "Number Edit Mask" dialog stack 
to set it.  From the dialog the user can enter a one-char thousands 
separator, a one-char decimal separator, a one to three char currency 
symbol, and instructions as to whether the currency symbol is 
prefixed or appended.

I don't particularly like the fact that the user must be prompted for 
number formatting preferences even when they are already known to the 
OS; but lacking a means of discovery via Transcript otherwise, what's 
a mother to do?

Adding system date/time functions was a step in the right direction 
for localization (except system time doesn't return any time 
separator other than ":", regardless of the system settings); however 
the job won't be completely finished until Transcript can also inform 
the developer what number format is in use on the currently-running 
system.  Until that happens, I humbly offer Serendipity Library's 
number formatting support:

<http://www.oenolog.net/ftp/serendipity_downloader.htm>


-- 

Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.net/who.htm

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)


More information about the use-livecode mailing list