You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I create a currency with 2 decimal places and then try format it in a locale with a country with no decimal places (eg. JAPAN), the USD amount gets displayed with no decimal digits.
Correct me if I am wrong but the locale in MonetaryAmountFormat using AmountFormatQueryBuilder is the locale in which we are displaying the MonetaryAmount and not necessarily the locale of the currency amount.
testFormat in this example would be shown as $10
What I am expecting is $10.32
Same is true the other way around.
MonetaryAmount moneyAmount = Money.of(10, "JPY");
MonetaryAmountFormat formatter = MonetaryFormats.getAmountFormat(
AmountFormatQueryBuilder.of(Locale.US)
.set(CurrencyStyle.SYMBOL)
.build());
String testFormat = formatter.format(moneyAmount);
testFormat is ¥10.00
What I am expecting is ¥10
The text was updated successfully, but these errors were encountered:
If I create a currency with 2 decimal places and then try format it in a locale with a country with no decimal places (eg. JAPAN), the USD amount gets displayed with no decimal digits.
Correct me if I am wrong but the locale in MonetaryAmountFormat using AmountFormatQueryBuilder is the locale in which we are displaying the MonetaryAmount and not necessarily the locale of the currency amount.
eg. of issue
MonetaryAmount moneyAmount = Money.of(10.32, "USD");
MonetaryAmountFormat formatter = MonetaryFormats.getAmountFormat(
AmountFormatQueryBuilder.of(Locale.JAPAN)
.set(CurrencyStyle.SYMBOL)
.build());
String testFormat = formatter.format(moneyAmount);
testFormat in this example would be shown as $10
What I am expecting is $10.32
Same is true the other way around.
MonetaryAmount moneyAmount = Money.of(10, "JPY");
MonetaryAmountFormat formatter = MonetaryFormats.getAmountFormat(
AmountFormatQueryBuilder.of(Locale.US)
.set(CurrencyStyle.SYMBOL)
.build());
String testFormat = formatter.format(moneyAmount);
testFormat is ¥10.00
What I am expecting is ¥10
The text was updated successfully, but these errors were encountered: