From b38463a5e35fa7dfd0f9dfbdc7fb637035fa1372 Mon Sep 17 00:00:00 2001 From: Brent Worden Date: Tue, 3 Jan 2006 16:47:38 +0000 Subject: [PATCH] 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 --- src/java/org/apache/commons/math/complex/ComplexFormat.java | 4 ++-- xdocs/changes.xml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/commons/math/complex/ComplexFormat.java b/src/java/org/apache/commons/math/complex/ComplexFormat.java index af9d37895..051a0d843 100644 --- a/src/java/org/apache/commons/math/complex/ComplexFormat.java +++ b/src/java/org/apache/commons/math/complex/ComplexFormat.java @@ -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 diff --git a/xdocs/changes.xml b/xdocs/changes.xml index e02e9867c..b59638409 100644 --- a/xdocs/changes.xml +++ b/xdocs/changes.xml @@ -39,6 +39,10 @@ Commons Math Release Notes + + Made ComplexFormat format double values with a provided NumberFormat + instance instead of using the real part format for all values. +