• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: numbers in words
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

-- 
Shane Stanley <email@hidden>
<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

References: 
 >numbers in words (From: Yvan KOENIG <email@hidden>)

  • Prev by Date: Re: Problem with Mavericks/Yosemite library
  • Next by Date: How can I get real printer name, please?
  • Previous by thread: numbers in words
  • Next by thread: How can I get real printer name, please?
  • Index(es):
    • Date
    • Thread