Rewrote function for better reliability

This commit is contained in:
Marvin Scham
2023-05-23 21:28:47 +02:00
parent 849ce7825d
commit 82ff5720e3

View File

@@ -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);
} }
} }