Replaced € symbol with text for charset safety
This commit is contained in:
@@ -25,7 +25,7 @@ public final class FormattingUtil {
|
|||||||
* @return formatted price
|
* @return formatted price
|
||||||
*/
|
*/
|
||||||
public static String formatEuro(final double amount) {
|
public static String formatEuro(final double amount) {
|
||||||
return String.format(Locale.GERMAN, "%,.2f", amount) + " €";
|
return String.format(Locale.GERMAN, "%,.2f", amount) + " Euro";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class FormattingUtilTest {
|
|||||||
@Test
|
@Test
|
||||||
void testFormatEuro_positiveAmount() {
|
void testFormatEuro_positiveAmount() {
|
||||||
double amount = 1234.56;
|
double amount = 1234.56;
|
||||||
String expectedFormattedAmount = "1.234,56 €";
|
String expectedFormattedAmount = "1.234,56 Euro";
|
||||||
|
|
||||||
String formattedAmount = FormattingUtil.formatEuro(amount);
|
String formattedAmount = FormattingUtil.formatEuro(amount);
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ class FormattingUtilTest {
|
|||||||
@Test
|
@Test
|
||||||
void testFormatEuro_zeroAmount() {
|
void testFormatEuro_zeroAmount() {
|
||||||
double amount = 0.0;
|
double amount = 0.0;
|
||||||
String expectedFormattedAmount = "0,00 €";
|
String expectedFormattedAmount = "0,00 Euro";
|
||||||
|
|
||||||
String formattedAmount = FormattingUtil.formatEuro(amount);
|
String formattedAmount = FormattingUtil.formatEuro(amount);
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ class FormattingUtilTest {
|
|||||||
@Test
|
@Test
|
||||||
void testFormatEuro_negativeAmount() {
|
void testFormatEuro_negativeAmount() {
|
||||||
double amount = -789.12;
|
double amount = -789.12;
|
||||||
String expectedFormattedAmount = "-789,12 €";
|
String expectedFormattedAmount = "-789,12 Euro";
|
||||||
|
|
||||||
String formattedAmount = FormattingUtil.formatEuro(amount);
|
String formattedAmount = FormattingUtil.formatEuro(amount);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user