summaryrefslogtreecommitdiffstats
path: root/libjava
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-05 21:25:23 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-05 21:25:23 +0000
commit629dd2940ce32f3d221838140b4e8553844ee769 (patch)
tree5c0c8dcf68b88e4b6603c25f6b31b7b1b44286eb /libjava
parent1358c56050a04ab3d07426f6e578451f86f0ba2d (diff)
downloadppe42-gcc-629dd2940ce32f3d221838140b4e8553844ee769.tar.gz
ppe42-gcc-629dd2940ce32f3d221838140b4e8553844ee769.zip
* java/text/DecimalFormat.java (format): Use localized minus sign
when generating exponent; never use `+'. Use floor to compute exponent. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46045 138bc75d-0d04-0410-961f-82ee72b054a4
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;
OpenPOWER on IntegriCloud