summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/java/text/DecimalFormat.java8
2 files changed, 12 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 2144b2ac84c..985e84bbb00 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,9 @@
+2001-10-05 Tom Tromey <tromey@redhat.com>
+
+ * java/text/DecimalFormat.java (format): Use localized minus sign
+ when generating exponent; never use `+'. Use floor to compute
+ exponent.
+
2001-10-05 Mark Wielaard <mark@klomp.org>
* java/util/zip/Adler32.java: Merge with Classpath
diff --git a/libjava/java/text/DecimalFormat.java b/libjava/java/text/DecimalFormat.java
index edf340027ed..a8a3db6d61a 100644
--- a/libjava/java/text/DecimalFormat.java
+++ b/libjava/java/text/DecimalFormat.java
@@ -442,7 +442,7 @@ public class DecimalFormat extends NumberFormat
double baseNumber;
if (useExponentialNotation)
{
- exponent = (long) (Math.log(number) / Math.log(10));
+ exponent = (long) Math.floor (Math.log(number) / Math.log(10));
if (minimumIntegerDigits > 0)
exponent -= minimumIntegerDigits - 1;
baseNumber = (long) (number / Math.pow(10.0, exponent));
@@ -523,7 +523,11 @@ public class DecimalFormat extends NumberFormat
if (useExponentialNotation)
{
dest.append(symbols.getExponential());
- dest.append(exponent < 0 ? '-' : '+');
+ if (exponent < 0)
+ {
+ dest.append (symbols.getMinusSign ());
+ exponent = - exponent;
+ }
index = dest.length();
for (count = 0;
exponent > 0 || count < minExponentDigits;
OpenPOWER on IntegriCloud