What is the preferred way to handle currencies in Java 8?
The things that could be of interest would be
* Currency Full Name (e.g. United States Dollar)
* Currency Abbreviation (e.g. USD)
* Currency Symbol (e.g. $)
Any other thing that I might be missing here?
What are the best options?
Java 8 still uses java.util.Currency and ISO 4217 codes. From the Javadoc,
Represents a currency. Currencies are identified by their ISO 4217 currency codes. Visit the ISO web site for more information, including a table of currency codes.
The class is designed so that there's never more than one
Currencyinstance for any given currency. Therefore, there's no public constructor. You obtain aCurrencyinstance using thegetInstancemethods.Users can supersede the Java runtime currency data by means of the system property
java.util.currency.data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With