Package net.thauvin.erik.frankfurter
Class CurrencyFormatter
java.lang.Object
net.thauvin.erik.frankfurter.CurrencyFormatter
Utility class for formatting currency values.
-
Method Details
-
format
Formats a currency amount based on the provided ISO currency symbol and amount.- Parameters:
symbol- the 3-letter ISO currency symbol (e.g., "USD", "EUR")amount- the monetary amount to format- Returns:
- a formatted currency string
- Throws:
IllegalArgumentException- if the currency symbol is unknown or invalid
-
format
Formats a currency amount based on the provided ISO currency symbol, amount, and rounding preference.- Parameters:
symbol- the 3-letter ISO currency symbol (e.g., "USD", "EUR")amount- the monetary amount to formatrounded- Whether to round the amount- Returns:
- a formatted currency string
- Throws:
IllegalArgumentException- if the currency symbol is unknown or invalid
-