Skip to content

Retrieve currency info by country code #92

Answered by Daniel-Ioannou
tom-NI asked this question in Q&A
Discussion options

You must be logged in to vote

@tom-NI Thank you for your positive feedback! I'm glad you find the library useful.

To retrieve currency information at runtime based on a country code you can use the CurrencyService().findByCode("EUR");.

Here's an example of how you can achieve this:

// Assuming you have the country code stored in SharedPreferences
String countryCode = // The country code from SharedPreferences;

// Use CurrencyService to find the currency information by code
Currency currency = CurrencyService().findByCode(countryCode);

// Now you can access various properties of the currency, such as symbol and decimal separator
String currencySymbol = currency.symbol;
String decimalSeparator = currency.decimalSepara…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tom-NI
Comment options

Answer selected by Daniel-Ioannou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants