Rewrote function for better reliability
This commit is contained in:
@@ -27,13 +27,6 @@ public final class FormattingUtil {
|
|||||||
* @return formatted price
|
* @return formatted price
|
||||||
*/
|
*/
|
||||||
public static String formatEuro(final double amount) {
|
public static String formatEuro(final double amount) {
|
||||||
// Set up environment
|
return String.format(Locale.GERMAN, "%,.2f", amount) + " €";
|
||||||
Locale locale = Locale.GERMANY;
|
|
||||||
Currency currency = Currency.getInstance("EUR");
|
|
||||||
NumberFormat numberFormat = NumberFormat.getCurrencyInstance(locale);
|
|
||||||
|
|
||||||
numberFormat.setCurrency(currency);
|
|
||||||
|
|
||||||
return numberFormat.format(amount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user