[Mono-bugs] [Bug 75566][Maj] New - Error on decimal.ToString (string);

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Jul 16 15:26:36 EDT 2005


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

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

--- shadow/75566	2005-07-16 15:26:36.000000000 -0400
+++ shadow/75566.tmp.18192	2005-07-16 15:26:36.000000000 -0400
@@ -0,0 +1,64 @@
+Bug#: 75566
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: albertoavila at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Error on decimal.ToString (string);
+
+Description of Problem:
+When you want to format a decimal using decimal.ToString (formatstring) you
+get a exception.
+
+I tried this on both linux and windows on mono 1.1.7.
+
+Steps to reproduce the problem:
+1. Create a sample c# source file like this:
+using System; 
+
+public class Foo {
+	
+	public static void Main (string[] args) {
+		decimal bar = 123456789.12m;
+		Console.WriteLine (bar.ToString ("$ ###,###,##0.00"));
+	}
+}
+
+
+2. 
+ Compile it: mcs FooBar.cs
+3. 
+ Run it¨: mono FooBar.exe
+
+Actual Results:
+
+Unhandled Exception: System.FormatException: The specified format is invalid
+in <0x003cc> System.DecimalFormatter:NumberToString (System.String format,
+Syste
+m.Globalization.NumberFormatInfo nfi, Decimal value)
+in <0x0006f> System.Decimal:ToString (System.String format, IFormatProvider
+prov
+ider)
+in <0x0000f> System.Decimal:ToString (System.String format)
+in <0x00052> Foo:Main (System.String[] args)
+
+
+Expected Results:
+When i run it with MS.NET i got the expected:
+C:\>test.exe
+$ 123,456,789.12
+
+C:\>
+
+How often does this happen? 
+Always


More information about the mono-bugs mailing list