[Mono-bugs] [Bug 70004][Nor] New - integer .ToString("#####.##") throws ArgumentOutOfRangeException (InvariantCulture)

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 29 Nov 2004 06:20:17 -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 atsushi@ximian.com.

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

--- shadow/70004	2004-11-29 06:20:17.000000000 -0500
+++ shadow/70004.tmp.14482	2004-11-29 06:20:17.000000000 -0500
@@ -0,0 +1,58 @@
+Bug#: 70004
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: atsushi@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: integer .ToString("#####.##") throws ArgumentOutOfRangeException (InvariantCulture)
+
+This code below throws an ArgumentOutOfRangeException.
+
+using System;
+using System.Globalization;
+
+public class Test
+{
+        public static void Main ()
+        {
+                Console.WriteLine (12.ToString ("#####.##",
+CultureInfo.Invarian
+tCulture));
+        }
+}
+
+Actual Results:
+Unhandled Exception: System.ArgumentOutOfRangeException: Index is less than
+0 or more than or equal to the list count.
+Parameter name: index
+-1
+in <0x00057> System.Collections.ArrayList:get_Item (int)
+in <0x00323> System.FormatParse:FormatPlain
+(char[],int&,System.Collections.ArrayList,System.FormatSection,int,int,bool)
+in <0x000bb> System.FormatParse:FormatDot
+(char[],int&,System.Collections.ArrayList,System.FormatSection,int,int)
+in <0x00170> System.FormatParse:FormatNumber (string,int)
+in <0x00087> System.IntegerFormatter:FormatCustom
+(string,long,System.Globalization.NumberFormatInfo,int)
+in <0x00080> System.IntegerFormatter:NumberToString
+(string,System.Globalization.NumberFormatInfo,int,int,long)
+in <0x00024> System.IntegerFormatter:NumberToString
+(string,System.Globalization.NumberFormatInfo,int)
+in <0x00038> System.Int32:ToString (string,System.IFormatProvider)
+in <0x0002f> Test:Main ()
+
+Expected Results:
+no error.
+
+How often does this happen? 
+consistently.