[Mono-bugs] [Bug 60227][Wis] Changed - System.Decimal class has different behaviour from MS implementation

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Feb 19 16:48:21 EST 2007


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 charlie at nunit.com.

http://bugzilla.ximian.com/show_bug.cgi?id=60227

--- shadow/60227	2006-05-08 11:05:53.000000000 -0400
+++ shadow/60227.tmp.7594	2007-02-19 16:48:21.000000000 -0500
@@ -74,6 +74,26 @@
 decimals, so we (well I) fixed around that (not redesigned).
 
 So the bug is a remainder that the current situation isn't perfect and
 will, someday, need to be addressed. IMO it would be nice to reuse
 SqlDecimal code (C# port of the current C code) and remove the decimal
 from the runtime.
+
+------- Additional Comments From charlie at nunit.com  2007-02-19 16:48 -------
+Additional "aspect" of this bug:
+
+Mono ToString("Gn") formatting differs from MS. MS always drops
+insignificant trailing zeros, Mono only does so if n <= the number of
+zeroes specified in initiating the value. The following passes on MS
+.Net 1.1 and 2.0, but fails on the second Assert in Mono 1.2.3.
+
+[Test]
+public void GnShouldDropInsignificantDigits()
+{
+    Assert.AreEqual( "7.12", 7.1200m.ToString("G4"), "G4" );
+    Assert.AreEqual( "7.12", 7.1200m.ToString("G6"), "G6" );
+}
+
+Note on Priority: This seems cosmetic, but NUnit depends on the MS
+behavior when comparing a decimal to any other numeric. "One of these
+days" we'll figure out a better way, but for now it's breaking us.
+


More information about the mono-bugs mailing list