Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Restore custom international number formats System 10.4
Tiger only hintI was looking for a way to restore a custom number formatting on my German localization under Tiger, as I am not satisfied that I cannot change the decimal separator in the way I want (in Germany, we use a comma as the standard decimal separator). I need this when I want Excel to recognize the dot separator on drag-and-drop text files, which I oftentimes work with, onto the dock icon.

I found a comment by macosxphile to an anonymous hint called Make 24-hour time work in iCal that contained an easy solution: Copy the Localization.prefPane from a Panther (10.3) system to a Tiger system (back up the original Tiger Localization.prefPane first). For geeks, here's a more detailed method: Control-click on Panther's Localization.prefPane (in /System -> Library -> Preference Panes), select "Show Package Contents" from the pop-up menu, and navigate to /Contents/Resources. Next, copy the IntlFormats.prefPane to the same location in Tiger's Localization.prefPane (as usual: backup the original one in advance).

The next time you start the Localization (International) preferences, you will see Panther's preferences panel, and you are able to set your own separator the way you want them (you can of course modify other things, too). Thanks to macosxphile for giving this brilliant hint!

So far so good. But how do you change the format by not destroying your Tiger look and feel?

After I made this fix the "easy way," I found my (invisble) ~/Library -> Preferences -> .GlobalPreferences.plist file, and tried modifying it instead of replacing the preferences panel.

This plist file is in binary mode. Read Edit binary (and normal) plist files with vim to learn how to use vim or plutil for converting plist files from binary to ASCII and vice versa.

After opening the file in an XML editor (Apple's Developer Tools sport the free PlistEditor.app), I found two new entries called AppleICUNumberFormatStrings and AppleICUNumberSymbols. You can paste the following example to your own .GlobalPreferences.plist file, and play around with it. The example given is for numbers with the comma as a thousands separator, the dot as a decimal separator, and the Euro sign after the last digit.
<key>AppleICUNumberFormatStrings</key>
    <dict>
        <key>2</key>
        <string>#,##0.00¤;-#,##0.00¤</string>
    </dict>
    <key>AppleICUNumberSymbols</key>
    <dict>
        <key>0</key>
        <string>.</string>
        <key>1</key>
        <string>,</string>
        <key>10</key>
        <string>.</string>
        <key>8</key>
        <string>€</string>
    </dict>
The next time you want to modify the number format, you'll have to change the separators manually in the .GlobalPreferences.plist file, or you could also create two or more .GlobalPrferences.plist files and rename them to switch between some schemes. If there is someone capable of writing an AppleScript application to modify the affecting XML keys on user input (via a GUI), that would be highly appreciated I guess.

Note that this trick works for one user only. I haven't tried it for a whole system in general, but there is a .GlobalPreferences.plist in /Library/Preferences, too. It might work as a systemwide settting.

Also note that you have to quit and launch Excel to make the change in number formatting take effect.

[robg adds: I haven't tested this one...]
    •    
  • Currently 3.67 / 5
  You rated: 5 / 5 (3 votes cast)
 
[17,241 views]  

10.4: Restore custom international number formats | 7 comments | Create New Account
Click here to return to the '10.4: Restore custom international number formats' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Restore custom international number formats
Authored by: sd on Oct 03, '05 12:30:21PM

Nice hint.
I was searching for the plist parameters for a long time.

I urge every people concerned by this issue to log a bug on Apple website:
http://bugreport.apple.com



[ Reply to This | # ]
10.4: Restore custom international number formats
Authored by: macfreek on Nov 09, '05 08:04:57AM

Thanks!!!!

This really is an excellent hint. So far, I just copied the 10.3 prefpane, but never realized I could just copy the affected pane, without affecting the other prefpanes.

I asked Apple a couple of times about this hideous new preference pane. My bugreport is from 9 May 2005, and is marked as a "duplicate" "serious bug". Note that you can bug devbugs@apple.com to ask about the status on "duplicate" bugs.



[ Reply to This | # ]
10.4: Restore custom international number formats
Authored by: madamov on Jan 15, '07 02:07:51AM

Unfortunaterly, copying prefpane doesn't work on Intel or I could not make it work.



[ Reply to This | # ]
10.4: Restore custom international number formats
Authored by: sd on Nov 24, '05 01:15:24PM
Here is the answer I got from Apple:
Please know that the original issue, Bug ID# 3863610, is still being investigated. I have checked with engineering, and the following workaround may be of help to you:

http://www.macosxhints.com/article.php?story=20050926170928881

Great, isnt't it?

[ Reply to This | # ]
10.4: Restore custom international number formats
Authored by: oPossumi on Sep 08, '06 05:40:40AM

Once again I was faced with this problem and this time the solution was simpler than anticipated. In 10.4.7, I just opened the above-mentioned invisible .GlobalPreferences.plist file and changed the value of AppleLocale to "en_FI" instead of "fi_FI". This way I can maintain my Finnish number formattings but enjoy a full English language presentation of dates.



[ Reply to This | # ]
10.4: Restore custom international number formats
Authored by: sd on Nov 26, '06 11:59:56AM

you may need also to edit ~/Library/Preferences/com.apple.HIToolbox.plist



[ Reply to This | # ]
10.4: Restore custom international number formats
Authored by: macfreek on Jan 27, '07 04:02:13PM

This drove (and still drives) me nuts. I tried to extensively found what parameters cause things to change. I found at least 4 different stories on the internet, but this at least seem to always work. A bit may be superfluous though.

Open a terminal, and type (for 1,746.18€ as number format):

defaults write .GlobalPreferences AppleICUNumberSymbols -dict 0 '.' 1 ',' 10 '.' 8 '€'
defaults write .GlobalPreferences AppleICUNumberFormatStrings -dict-add 2 '#,##0.00¤;-#,##0.00¤'
defaults write com.apple.HIToolbox AppleDecimalSeparator -dict smRoman '.'
defaults write com.apple.HIToolbox AppleThousandSeparator -dict smRoman ','
defaults write com.apple.systempreferences AppleIntlCustomFormat -dict-add AppleDecimalSeparator '.'
defaults write com.apple.systempreferences AppleIntlCustomFormat -dict-add AppleThousandSeparator ','

or type (for €1 746.18 as number format):

defaults write .GlobalPreferences AppleICUNumberSymbols -dict 0 '.' 1 ' ' 10 '.' 8 '€'
defaults write .GlobalPreferences AppleICUNumberFormatStrings -dict-add 2 '¤# ##0.00;¤-# ##0.00'
defaults write com.apple.HIToolbox AppleDecimalSeparator -dict smRoman '.'
defaults write com.apple.HIToolbox AppleThousandSeparator -dict smRoman ' '
defaults write com.apple.systempreferences AppleIntlCustomFormat -dict-add AppleDecimalSeparator '.'
defaults write com.apple.systempreferences AppleIntlCustomFormat -dict-add AppleThousandSeparator ' '


[ Reply to This | # ]