> In the mainwindow account balaces are displayed with the currency symbol
> ($ for USD, Fr. for CHF etc.) in front of them. The bug here is that
> whether it's a "foreign" currency or not, it's allways the same symbol
> that's displayed. This symbol is ultimatively fetched through 
> localconv() and for that reason doesn't care about what currency the
> account is in but only about the locales settings:

Hi Tomas,

First, sorry it took so long for me to get back to you. I've been
at Comdex and their flaky network would let me check email but not
reply. Very frustrating!!

You are quite right that our current method of printing currencies
leaves much to be desired :) I noticed at the end of your message
you seemed to have some interest in remedying the problem. Thank
you! I would like to share my thoughts on a possible solution.

First, as far as displaying the currency symbol in the balance,
I would prefer to make this configurable rather than take it out
altogether. Yes, you can turn on the currency column, but that
takes up a lot more space than printing the currency with the
balance & total.

As far as printing the symbol correctly for a given currency,
I was envisioning the following sort of solution:

The amount printing routines (xaccPrintAmount & xaccSPrintAmount)
would be extended with an argument for the currency code string.
If the string was NULL, it would default to using the locale
currency. That would make it a little easier to modify the
existing code on a gradual basis. Also, when you are printing,
e.g., a quantity of shares there is no need for one.

If the currency given to the amount printers was the same as
the default locale currency, it would print the currency symbol
using that given by the locale. If it did not match, it would
print the currency code string in front of the amount separated
by a space.

In pseudo-code: print(10, "USD") gives "$10" in the en_US locale and
                "USD 10" in any other locale.

I don't think we should try to map currency codes to locale-ized
currency symbols, because currency symbols are not guaranteed to
be unique. For example, I believe that in Australia, amounts in
Australian dollars are printed using the '$' symbol, just as USD
are printed in the US.

Because of this, I don't think gnc_localeconv needs to know the
"currency context" at all.

thanks,
dave

--
Gnucash Developer's List 
To unsubscribe send empty email to: [EMAIL PROTECTED]


Reply via email to