setlocale, LC_MONETARY, ISO-4217

R

remi.chateauneu

Questions please about setlocale and http://en.wikipedia.org/wiki/ISO_4217
:

* This ISO standard states that all official currencies are coded on
three letters. Is there any data type using a simple longword to store
a currency ? I have seen too many times currencies coded with a const
char *, or a std::string, and there would be a big performance gain by
using a simple long, no ? It could be a simple C structure, optionaly
wrapped in a C++ class with a conversion operator to std::string,
concatenation operators, a hash function, etc...

* setlocale(LC_MONETARY) is adapted to situations where one country
has one currency. But in financial applications, there is usually one
'text' locale, but on the other hands, many different currencies are
used, so it seems that this model is not the best adapted (Think about
USD, USN and USS). In other words, is there a way to pick up form all
locales, all the characteristics of each available currencies ?

* ISO-4217 defines other interesting data such as the relationship
between the major currency unit and any minor currency unit, or a
three-digit currency code as a number. Is is formalized in some way by
POSIX's setlocale ? Is there a way to update online this ISO database,
for example to check at run-time whether a currency is valid or not.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top