Re: numbers in words
Re: numbers in words
- Subject: Re: numbers in words
- From: Shane Stanley <email@hidden>
- Date: Sun, 07 Jun 2015 12:33:26 +1000
On 7 Jun 2015, at 6:55 am, Yvan KOENIG <email@hidden> wrote:
It works well but it suffers of an oddity introduced by Apple engineers which decided - what a surprise - that they are the only ones knowing how numbers are written in french.
For them, 123.45 is supposed to be spelled : "cent vingt-trois virgule quatre cinq" which is wrong. It must be spelled "cent vingt-trois virgule quarante-cinq"
As I'm quite sure that getting a corrected code from Apple would require years, I decided to write customised handlers.
Just a correction: it's not really anything to do with Apple engineers. The localization information is all collated by the ICU < http://site.icu-project.org>. Apple just uses their libraries.
I think also that the conversion is meant to be good enough for use in documents like computer-generated chèques, not conversation.
Alas, I'm not at ease with the help pages of xCode and given that, I found no clean way to get the current localeIdentifier.
You ask the NSLocale class for the currentLocale, from which you can get the identifier, as well as the decimal separator:
current application's NSLocale's currentLocale()'s identifier() as text (current application's NSLocale's currentLocale()'s objectForKey:(current application's NSLocaleDecimalSeparator)) as text
|
_______________________________________________
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