Re: Currencies list?



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]