Replaced € symbol with text for charset safety

This commit is contained in:
Shan Ruhhammer
2023-06-25 03:17:35 +02:00
parent 7c00e25e56
commit 8d9fa83cd7
2 changed files with 4 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ public final class FormattingUtil {
* @return formatted price
*/
public static String formatEuro(final double amount) {
return String.format(Locale.GERMAN, "%,.2f", amount) + " ";
return String.format(Locale.GERMAN, "%,.2f", amount) + " Euro";
}
/**

View File

@@ -29,7 +29,7 @@ class FormattingUtilTest {
@Test
void testFormatEuro_positiveAmount() {
double amount = 1234.56;
String expectedFormattedAmount = "1.234,56 ";
String expectedFormattedAmount = "1.234,56 Euro";
String formattedAmount = FormattingUtil.formatEuro(amount);
@@ -39,7 +39,7 @@ class FormattingUtilTest {
@Test
void testFormatEuro_zeroAmount() {
double amount = 0.0;
String expectedFormattedAmount = "0,00 ";
String expectedFormattedAmount = "0,00 Euro";
String formattedAmount = FormattingUtil.formatEuro(amount);
@@ -49,7 +49,7 @@ class FormattingUtilTest {
@Test
void testFormatEuro_negativeAmount() {
double amount = -789.12;
String expectedFormattedAmount = "-789,12 ";
String expectedFormattedAmount = "-789,12 Euro";
String formattedAmount = FormattingUtil.formatEuro(amount);