Re: Currencies list?
- From: Murray Cumming <murrayc murrayc com>
- To: Danilo Šegan <danilo gnome org>
- Cc: gnome-i18n <gnome-i18n gnome org>, Simos Xenitellis <simos74 gmx net>
- Subject: Re: Currencies list?
- Date: Wed, 30 Mar 2005 15:16:49 +0200
On Wed, 2005-03-30 at 15:06 +0200, Danilo Åegan wrote:
> Yesterday at 17:41, Murray Cumming wrote:
>
> > - how could I get a translation of a currency name, in the current
> > locale?
>
> As for current locale, why not use strfmon or localeconv instead?
>
> #include <monetary.h>
> #include <locale.h>
>
> int main(void) {
> char dump[100];
> struct lconv *info;
>
> setlocale(LC_ALL,"");
> info = localeconv();
>
> strfmon(dump, 100, "%n", 123.45);
> printf("%s\nint_curr_symbol: %s\ncurrency_symbol: %s\n", dump, info->int_curr_symbol, info->currency_symbol);
>
> return 0;
> }
>
> This gives me in sr_CS locale:
>
> 123,45 ÐÐÐ
> int_curr_symbol: CSD
> currency_symbol: ÐÐÐ
>
> Of course, if you need to list all the currencies and allow user to
> select them, then using iso-codes is likely much better.
Yes, I do need a list, but thanks for the suggestion. I can use that to
offer a good default.
--
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]