fixed format tests

This commit is contained in:
Juergen Hoeller
2009-09-08 00:15:09 +00:00
parent 0d084bd7f8
commit 70038bcf3c
5 changed files with 86 additions and 8 deletions

View File

@@ -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;
}