[Mono-bugs] [Bug 23354] Changed - Decimal.ToString() handles format "g4" incorrectly
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
16 Apr 2002 09:09:40 -0000
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by ndrochak@gol.com.
http://bugzilla.ximian.com/show_bug.cgi?id=23354
--- shadow/23354 Fri Apr 12 11:24:25 2002
+++ shadow/23354.tmp.5388 Tue Apr 16 05:09:39 2002
@@ -1,14 +1,14 @@
Bug#: 23354
Product: Mono/Class Libraries
Version: unspecified
-OS:
+OS: unknown
OS Details:
Status: NEW
Resolution:
-Severity:
+Severity: Unknown
Priority: Wishlist
Component: CORLIB
AssignedTo: mono-bugs@ximian.com
ReportedBy: ndrochak@gol.com
QAContact: mono-bugs@ximian.com
TargetMilestone: ---
@@ -22,6 +22,26 @@
d = 12000m;
string s = d.ToString("g4", NumberFormatInfo.InvariantInfo);
Incorrectly puts "-1.200e+4" into s, when it should put "1.2e+04"
Notice the extra zero's in the incorrect string.
+
+------- Additional Comments From ndrochak@gol.com 2002-04-16 05:09 -------
+proper test code:
+
+namespace NS {
+ class C {
+ public static int Main() {
+ decimal d;
+ d = 12000m;
+ string s = d.ToString("g4",
+System.Globalization.NumberFormatInfo.InvariantInfo);
+ if (s == "1.2e+04")
+ return 0;
+ else
+ return 1;
+ }
+
+ }
+
+}