Problems trying to get currency separator correct for CAD

John Ralls jralls at ceridwen.us
Fri Jul 22 11:17:23 EDT 2011


On Jul 22, 2011, at 9:52 AM, bunk3m wrote:

> On 22.07.2011 09:21, John Ralls wrote:
>> On Jul 22, 2011, at 9:00 AM, John Ralls wrote:
>> 
>>> On Jul 21, 2011, at 5:58 PM, bunk3m wrote:
>>> 
>>>> Thank you, John.
>>>> 
>>>> In the earlier part of my post which I guess got lost, I mentioned that
>>>> I had already tried to do this using the wiki post.
>>>> 
>>>> In the FAQ it says to do the following command to customize: "defaults
>>>> write -app Gnucash AppleLocale = "en_US at currency=CAD" "
>>>> 
>>>> This command should actually be:
>>>> 
>>>> defaults write -app /Applications/Gnucash/Gnucash.app
>>>> AppleLocale="en_US at currency=CAD"
>>>> 
>>>> But I get an error:
>>>> 2011-07-20 13:42:44.553 defaults[4877:10b]
>>>> Rep argument is not a dictionary
>>>> Defaults have not been changed.
>>>> 
>>>> Can you help me with understanding why the command didn't work?
>>> Apparently not; it isn't working for me on my MBA, either. 
>>> 
>>> The syntax *is* correct in the FAQ article. See "Specifying Domains" in the defaults manpage. I'll have to figure out why it doesn't work for Gnucash.
>> Well,,, the syntax was *almost* correct in the Wiki article (it's fixed now, with a note).
>> The command is:
>> 
>> defaults write -app Gnucash AppleLocale 'en_US at currency=CAD'
>> 
>> Note the single quotes. It's the double quotes that were causing the error.
>> 
>> Regards,
>> John Ralls
> 
> Thank you for helping out with the command, John.
> 
> Gnucash preferences:account has always shown the Default Currency to be
> Locale: CAD (Canadian Dollar).  This has always been selected.
> 
> When I typed the command you posted above I got:
>   $ defaults write -app Gnucash AppleLocale 'en_US at currency=CAD'
> 
>   $ 2011-07-22 09:37:03.093 defaults[2413:10b] Couldn't find an
> application named "Gnucash"; defaults unchanged
> 
> So I changed it to:
> 
>   $ defaults write -app /Applications/Gnucash/Gnucash.app AppleLocale
> 'en_US at currency=CAD'
> 
> This appears to have worked since there was no error message.  However,
> I still have a comma for the currency separator between the dollars and
> cents. ie. 1 234,56 $
> 
> :-(
> 
> There appears to be a bigger problem at play here. 
> 
> I took one of the other suggestions and changed the Default currency to
> USD.  Then I changed the currency of the cheque account to USD also.  I
> was hoping to get $1,234.56 as USD has the same currency separator as
> Canada.  Now I'm getting:
> 
>   USD 1 234,56
> 
> Ha ha ha.  This is nuts!   Grrrrr!!!
> 
> I restarted Gnucash just to see if that would make a difference.  But no
> joy.
> 
> So I change it back to CAD.  
> 
> Do you have any other suggestion?

Cool!

If you give a path to the application, leave off the -app flag:

defaults write /Applications/Gnucash/Gnucash.app AppleLocale 'en_US at currency=CAD'

back-test it with 

defaults read -app Gnucash AppleLocale
defaults read org.gnucash.Gnucash AppleLocale
defaults read /Applications/Gnucash/Gnucash.app AppleLocale

They should all report the same thing unless defaults is utterly confused by having the app in an unconventional location (it sure shouldn't be).

After futzing about with the account currencies to get two of them to work, I have CAD as the default currency from the locale and amounts in USD show as USD 1,234.56 while amounts in CAD show as $1,234.56.

What shows as the locale default currency in Gnucash? If it's CAD, then that part is working. Numeric formatting is actually independent of currency, and as you know, en_CA and en_US should produce the same results -- so just setting en_CA should do what you want. 

What is the result of 
defaults read -g AppleLocale ?

Regards,
John Ralls





More information about the gnucash-user mailing list