mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
fixed format tests
This commit is contained in:
+7
-5
@@ -77,11 +77,13 @@ public final class CurrencyFormatter extends AbstractNumberFormatter {
|
||||
|
||||
public BigDecimal parse(String formatted, Locale locale) throws ParseException {
|
||||
BigDecimal decimal = (BigDecimal) super.parse(formatted, locale);
|
||||
if (this.roundingMode != null) {
|
||||
decimal = decimal.setScale(this.fractionDigits, this.roundingMode);
|
||||
}
|
||||
else {
|
||||
decimal = decimal.setScale(this.fractionDigits);
|
||||
if (decimal != null) {
|
||||
if (this.roundingMode != null) {
|
||||
decimal = decimal.setScale(this.fractionDigits, this.roundingMode);
|
||||
}
|
||||
else {
|
||||
decimal = decimal.setScale(this.fractionDigits);
|
||||
}
|
||||
}
|
||||
return decimal;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user