summaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-10-05 21:25:23 +0000
committerTom Tromey <tromey@gcc.gnu.org>2001-10-05 21:25:23 +0000
commitcb9ad228b6a92f14b1a7e9b4e60753368a14078f (patch)
tree5c0c8dcf68b88e4b6603c25f6b31b7b1b44286eb /libjava
parent2f9ce23c1cc2edac49379623f11d06235c9ee6fa (diff)
downloadgcc-cb9ad228b6a92f14b1a7e9b4e60753368a14078f.tar.gz
DecimalFormat.java (format): Use localized minus sign when generating exponent; never use `+'.
* java/text/DecimalFormat.java (format): Use localized minus sign when generating exponent; never use `+'. Use floor to compute exponent. From-SVN: r46045
Diffstat (limited to 'libjava')
-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;