[Mono-bugs] [Bug 79977][Wis] New - [PATCH] Decimal did not implement AwayFromZero Rounding.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Nov 19 03:58:22 EST 2006


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 redforks at gmail.com.

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

--- shadow/79977	2006-11-19 03:58:22.000000000 -0500
+++ shadow/79977.tmp.5172	2006-11-19 03:58:22.000000000 -0500
@@ -0,0 +1,34 @@
+Bug#: 79977
+Product: Mono: Class Libraries
+Version: 1.2
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: redforks at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [PATCH] Decimal did not implement AwayFromZero Rounding.
+
+Decimal did not implement AwayFromZero Rounding.
+
+Its feature is very critical to my class library. So I hacked it using:
+
+			return decimal.Parse(d.ToString("0." + new string('#', decimals),
+System.Globalization.NumberFormatInfo.InvariantInfo),
+System.Globalization.NumberFormatInfo.InvariantInfo);
+
+I know the ToString() handles the AwayFromZero Rounding internally, but not
+easy to split it out.
+
+I also found Decimal rounding is a little mass:
+
+  1. there is a internal function decimalRound, but don't used
+  2. Math.Round(decimal) don't call Decimal.Round(), and do itself.
+Decimal.Round() isn't correct?


More information about the mono-bugs mailing list