[GNC] [SPAM] Re: Decimal points messed up

John Ralls jralls at ceridwen.us
Sat Aug 24 12:40:16 EDT 2019



> On Aug 23, 2019, at 9:59 PM, Axel Essbaum <axel at essbaum.com> wrote:
> 
>> 
>> On 23 Aug 2019, at 23:10, John Ralls <jralls at ceridwen.us> wrote:
>>> On Aug 23, 2019, at 9:01 AM, Axel Essbaum <axel at essbaum.com> wrote:
>>> Hi All,
>>> 
>>> Longtime Mac GC user, still running my original 2.4.11 install from… 10 years ago?  I am now looking at upgrading to 3.6 and am encountering a problem with the "grouping" character and decimal points being transposed.  I am using GC with CHF (I am in Switzerland), but my computer is set up in English.
>>> 
>>> In System Prefs > Langauge and Region I have Region = Switzerland.  On that pane in Advanced I have Number Separator Grouping = ' and decimal = .  Currency is CHF and Currency Grouping = ' and decimal = .
>>> 
>>> In GC Prefs I have Locale = CHF (Swiss Franc).
>>> 
>>> But two thousand CHF, which I would expect to see as CHF 2'000.00 is actually displayed SFr. 2.000,00.
>>> 
>>> I can live with SFr. but I can't have a decimal point used for grouping.
>>> 
>>> Anyone have any ideas what I can adjust to fix this?
>> 
>> The problem is that while Apple's native localization (based on a library called ICU) has the correct numeric and monetary formats for Switzerland, their C runtime library localization files that GnuCash uses have the wrong values for thousands separator and decimal point.
>> 
>> MacOS won't let you edit the file even with admin privileges (i.e. sudo) and AFAIK no other country uses an apostrophe for the thousands separator so I don't think that there's any way to get the apostrophe thousands separator short of switching to Linux.
>> 
>> Since you're using GnuCash in English anyway you could just tell defaults
>>  defaults write -a Gnucash AppleLocale en_GB.UTF-8
>> and it will use comma for the thousands separator and dot for the decimal point. You'll want to change the default currency in Preferences on the Accounts and Reports tabs to CHF instead of locale.
> 
> Hi John,
> 
> Thanks for the helpful response.  I am happy with a comma separator.  But I get:
> 
> $ defaults write -a Gnucash AppleLocale en_GB.UTF-8
> 2019-08-24 06:54:51.749 defaults[13856:1130038] Unexpected argument en_GB.UTF-8; leaving defaults unchanged.
> 
> This is Mojave, btw.
> 
> Any idea what I need to do different?
> 
> Thanks!

Sorry, the option is -app and you need to single-quote the locale:
   defaults write -app Gnucash AppleLocale 'en_GB.UTF-8'
Sometimes the defaults system is persnickety and denies knowing about Gnucash:
"Can't determine domain name for application Gnucash; defaults unchanged" in which case you can tell it the full path
   defaults write -app /Applications/Gnucash.app AppleLocale 'en_GB.UTF-8'

Regards,
John Ralls



More information about the gnucash-user mailing list