Problems trying to get currency separator correct for CAD

John Ralls jralls at ceridwen.us
Fri Jul 22 14:16:04 EDT 2011


On Jul 22, 2011, at 1:03 PM, Vasyĺ V. Vercynśkyj wrote:

> […]
>> This would be a bug in the locale configuration, not a bug in GnuCash.
>> GnuCash just uses what the locale says to use.
>> 
>> -derek
> 
> I hardly believe that the problem is in locale:
> 1. Bug reproduces on different not related distros (and developers of one assure that the problem is in GnuCash but locale).
> 2. Another applications (Calculator, KMyMoney) give comma as the decimal separator whatever.
> 
> Let me explain you more clearly.
> 
> CONDITIONS:
> 1. My default locale is ru_RU.UTF-8 (or ru_UA.UTF-8).
> 2. I use two languages: English and Russian.
> 3. I use numeric keypad for entering amounts.
> 4. "Del" key from numeric keypad gives *period* when English is selected and *comma* when Russian is selected.
> 
> WHAT IS EXPECTED (when Gnucash starts in ru_RU.UTF-8 or ru_UA.UTF-8 locale):
> 1. All amounts should be displayed with *comma* -- FALSE: there is *period*.
> 2. When amount is entered the numeric "Del" key gives *comma* whatever language is selected -- FALSE: in English gives *period* in Russian gives nothing.
> 
> Lets try another locale.
> WHAT IS EXPECTED (when Gnucash starts in uk_UA.UTF-8 or fr_FR.UTF-8 locale):
> 1. -- TRUE!
> 2. -- TRUE!
> 
> And what about this:
> WHAT IS EXPECTED (when Gnucash starts in en_US.UTF-8 locale):
> 1. All amounts should be displayed with *period* -- TRUE.
> 2. When amount is entered the numeric "Del" key gives *period* whatever language is selected -- FALSE: in English gives *period* in Russian gives *comma*.
> 
> This symptoms are same for Ubuntu 11.04 and AltLinux/Sisyphus.
> 
> BTW, I don't use OSX.
Vasil,

There seems to be two things going on here: One is keyboard translation (numeric keypad "." prints the wrong character) and numeric formatting when printing (decimal is a "." when you think it should be a ",").

I can't really address the first problem without knowing how you're setting your locale, and I don't have an Ubuntu VM to test in.

However, when I check in Python on my Fedora VM, I get the following valuest:
	mon_decimal_point	decimal_point	thousands_sep  mon_thousands_sep
ru_RU: 		.			,		'\xa0'		'\xa0'
ru_UA: 		.			,		.		,
uk_UA: 		,			,		'\x9a'		'\x9a'
uk_RU: Error, not a valid locale
fr_FR:		,			,		.		.

When I check in System Prefs on my Mac, I see a space for a thousands separator and a comma (",") for a decimal separator, for both money and otherwise, for all both Russia and Ukraine in both Russian and Ukrainian.

You should run the same python experiment on your Ubuntu box. The commands are:
>>>import locale
>>>locale.setlocale(locale.LC_ALL, "ru_RU")
>>>locale.localeconv()

If the values aren't what you expect, then your beef is with whoever maintains the locales package either at Canonical or Debian. If the values are what you expect, but gnucash is getting it wrong, then please file a bug against Gnucash.

Regards,
John Ralls





More information about the gnucash-user mailing list