Fix money conversion for JPY in PremiumListDao (#463)

This commit is contained in:
Shicong Huang
2020-01-29 13:10:58 -05:00
committed by GitHub
parent d03cea2443
commit 955c3d9aeb
2 changed files with 39 additions and 1 deletions
@@ -156,7 +156,11 @@ public class PremiumListDao {
RevisionIdAndLabel.create(premiumList.getRevisionId(), label);
try {
Optional<BigDecimal> price = PremiumListCache.cachePremiumEntries.get(revisionIdAndLabel);
return price.map(p -> Money.of(premiumList.getCurrency(), p));
return price.map(
p ->
Money.of(
premiumList.getCurrency(),
p.setScale(premiumList.getCurrency().getDecimalPlaces())));
} catch (InvalidCacheLoadException | ExecutionException e) {
throw new RuntimeException(
String.format(