fixed format tests

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1839 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller
2009-09-08 00:15:09 +00:00
parent 7bec7d79f9
commit 8986b17038
5 changed files with 86 additions and 8 deletions
@@ -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;
}