[Mono-bugs] [Bug 69935][Min] New - Integer Formatting in mono is not compatible with MS.Net

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 26 Nov 2004 02:06:45 -0500 (EST)


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 shervin01@hotmail.com.

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

--- shadow/69935	2004-11-26 02:06:45.000000000 -0500
+++ shadow/69935.tmp.13312	2004-11-26 02:06:45.000000000 -0500
@@ -0,0 +1,58 @@
+Bug#: 69935
+Product: Mono: Class Libraries
+Version: 1.1
+OS: GNU/Linux [Other]
+OS Details: Fedora Core 2.
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: shervin01@hotmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Integer Formatting in mono is not compatible with MS.Net
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+Integer formatting will pad 0's at the beggining of the string under mono
+while MS.net does not, if the formatting length is bigger than the numder
+of digits in that number.
+
+Steps to reproduce the problem:
+
+Following code will produce different results under mono and MS.Net
+
+Response.Write(String.Format("{0:#,###}", 2) + <br>");
+Response.Write(String.Format("{0:#,###}", 2000) + "<br>");		
+Response.Write(String.Format("{0:#,###}", 2000000) + "<br>");
+
+Actual Results:
+
+Under Mono:
+,002
+2,000
+2,000,000
+
+Expected Results:
+
+Under MS.Net:
+2
+2,000
+2,000,000
+
+How often does this happen? 
+
+Always
+
+Additional Information:
+
+You can easily work around this if you are formatting one integer or you
+are doing a loop through data yourself, but when using DataFormatString
+inside a datagrid for boundcolumns this becomes a real problem.
+
+This code has been tested under Mono 1.1.2.99 and MCS 1.1.2.0 (Latest from SVN)