Im used to seeing a . for the decimal point delimiter, but a user has written to say a comma is used in many countries instead.
Is it possible to easily pick up the system setting for the delimiter in both Windows and Mac, and have Livecode display numbers using that delimiter rather than default to the .?
Thanks
Decimal point delimiter
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Decimal point delimiter
Hi Andy,
In my country, the Netherlands, we use the comma instead of the dot, just like all over continental Europe. There is no easy way to accommodate this in Rev. If I have to use a the comma as the decimal delimiter in Rev, I do the calculations with the dot and replace the dot with a comma only when I'm going to display the result.
Kind regads,
Mark
In my country, the Netherlands, we use the comma instead of the dot, just like all over continental Europe. There is no easy way to accommodate this in Rev. If I have to use a the comma as the decimal delimiter in Rev, I do the calculations with the dot and replace the dot with a comma only when I'm going to display the result.
Kind regads,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Decimal point delimiter
You can make the display of decimal dot or comma choice reasonably painless by always working in the dot format internally and using a setProp handler to trigger a reformatting according to the choice before the value is put into a field.
You could adapt something from this discussion to achieve the results needed, perhaps: http://forums.runrev.com/phpBB2/viewtop ... 704#p12704
To get the system settings for what the current user's decimal separator looks like from within Livecode is not easy though, as Mark says. I don't believe there is anything built in that Livecode includes (as one of its globals) that it would be possible to use to retrieve it. On Windows 7, you can interrogate the registry key HK_CURRENT_USER\Control Panel\International and find the entry for sDecimal. I'm unable to check at the moment with earlier versions of Windows whether it is the same key. For Mac OS X, Linux or any mobile flavour... no idea, sorry.
You could adapt something from this discussion to achieve the results needed, perhaps: http://forums.runrev.com/phpBB2/viewtop ... 704#p12704
To get the system settings for what the current user's decimal separator looks like from within Livecode is not easy though, as Mark says. I don't believe there is anything built in that Livecode includes (as one of its globals) that it would be possible to use to retrieve it. On Windows 7, you can interrogate the registry key HK_CURRENT_USER\Control Panel\International and find the entry for sDecimal. I'm unable to check at the moment with earlier versions of Windows whether it is the same key. For Mac OS X, Linux or any mobile flavour... no idea, sorry.
Re: Decimal point delimiter
Thanks, the setprop in the other thread will work and Im guessing Ill need a getprop as well as the user will almost certainly use the comma when entering values if it is shown.
Ill try to figure out how to get the system setting on a mac, it must be possible with a shell command of some kind.
Thanks again.
Andy
Ill try to figure out how to get the system setting on a mac, it must be possible with a shell command of some kind.
Thanks again.
Andy