PR: 38091

ComplexFormat was not formatting double values with the provided NumberFormat.  Instead, the real part format was always used.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@365680 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brent Worden 2006-01-03 16:47:38 +00:00
parent 61f59a02e6
commit b38463a5e3
2 changed files with 6 additions and 2 deletions

View File

@ -212,7 +212,7 @@ public class ComplexFormat extends Format implements Serializable {
toAppendTo.append(value);
toAppendTo.append(')');
} else {
getRealFormat().format(value, toAppendTo, pos);
format.format(value, toAppendTo, pos);
}
return toAppendTo;
}
@ -467,7 +467,7 @@ public class ComplexFormat extends Format implements Serializable {
*/
private Number parseNumber(String source, NumberFormat format, ParsePosition pos) {
int startIndex = pos.getIndex();
Number number = getRealFormat().parse(source, pos);
Number number = format.parse(source, pos);
int endIndex = pos.getIndex();
// check for error parsing number

View File

@ -39,6 +39,10 @@ Commons Math Release Notes</title>
</properties>
<body>
<release version="1.2-SNAPSHOT" date="TBD">
<action dev="brentworden" type="fix" issue="38091" due-to="Phil Steitz">
Made ComplexFormat format double values with a provided NumberFormat
instance instead of using the real part format for all values.
</action>
</release>
<release version="1.1" date="2005-12-17"
description="This is a maintenance release containing bug fixes and enhancements.