[Mono-bugs] [Bug 71286][Nor] Changed - Double formating error.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 14 Jan 2005 19:39:27 -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 miguel@ximian.com.

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

--- shadow/71286	2005-01-14 17:32:02.000000000 -0500
+++ shadow/71286.tmp.14737	2005-01-14 19:39:27.000000000 -0500
@@ -1,14 +1,14 @@
 Bug#: 71286
 Product: Mono: Class Libraries
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: CORLIB
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: miguel@ximian.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -114,6 +114,127 @@
 		NumberFormat = GetNumberFormat2();			
 		FormatStringTest ("DblFn2 #15", NumberFormat, 99999.9999996, "E67",
 "9.9999999999599997000000000000000000000000000000000000000000000000000E+004");
  
 	}
 }
+
+------- Additional Comments From miguel@ximian.com  2005-01-14 19:39 -------
+More failures follow (separate program):
+using System.Globalization;
+using System;
+
+class X {
+		static private NumberFormatInfo GetNumberFormat1()
+		{
+			NumberFormatInfo format = new NumberFormatInfo();
+			
+			format.NaNSymbol = "NaN";
+			format.PositiveSign = "+";
+			format.NegativeSign = "-";
+			format.PerMilleSymbol = "x";
+			format.PositiveInfinitySymbol = "Infinity";
+			format.NegativeInfinitySymbol = "-Infinity";
+			
+			format.NumberDecimalDigits = 5; 
+			format.NumberDecimalSeparator = ",";
+			format.NumberGroupSeparator = ".";
+			format.NumberGroupSizes = new int[] {3};
+			format.NumberNegativePattern = 2;
+			
+			format.CurrencyDecimalDigits = 2;
+			format.CurrencyDecimalSeparator = ",";
+			format.CurrencyGroupSeparator = ".";
+			format.CurrencyGroupSizes = new int[] {3};
+			format.CurrencyNegativePattern = 8;
+			format.CurrencyPositivePattern = 3;
+			format.CurrencySymbol = "EUR";
+			
+			format.PercentDecimalDigits = 5; 
+			format.PercentDecimalSeparator = ",";
+			format.PercentGroupSeparator = ".";
+			format.PercentGroupSizes = new int[] {3};
+			format.PercentNegativePattern = 0;
+			format.PercentPositivePattern = 0;
+			format.PercentSymbol = "%";
+			
+			return format;
+		}
+		
+		static private NumberFormatInfo GetNumberFormat2()
+		{
+			NumberFormatInfo format = new NumberFormatInfo();
+			
+			format.NaNSymbol = "Geen";
+			format.PositiveSign = "+";
+			format.NegativeSign = "-";
+			format.PerMilleSymbol = "x";
+			format.PositiveInfinitySymbol = "Oneindig";
+			format.NegativeInfinitySymbol = "-Oneindig";
+			
+			format.NumberDecimalDigits = 2; 
+			format.NumberDecimalSeparator = ".";
+			format.NumberGroupSeparator = ",";
+			format.NumberGroupSizes = new int[] {3};
+			format.NumberNegativePattern = 1;
+			
+			format.CurrencyDecimalDigits = 1;
+			format.CurrencyDecimalSeparator = ".";
+			format.CurrencyGroupSeparator = ",";
+			format.CurrencyGroupSizes = new int[] {3};
+			format.CurrencyNegativePattern = 3;
+			format.CurrencyPositivePattern = 1;
+			format.CurrencySymbol = "$";
+			
+			format.PercentDecimalDigits = 2; 
+			format.PercentDecimalSeparator = ".";
+			format.PercentGroupSeparator = ",";
+			format.PercentGroupSizes = new int[] {3};
+			format.PercentNegativePattern = 1;
+			format.PercentPositivePattern = 2;
+			format.PercentSymbol = "##";
+			
+			return format;
+		}
+	static void FormatStringTest(string TestNumber, NumberFormatInfo
+NumberFormat, double Number, string Format, string ExpectedResult)
+	{
+		if (ExpectedResult != Number.ToString(Format, NumberFormat))
+			Console.WriteLine ("Failed: " + TestNumber);
+	}
+	
+	static void Main ()
+	{
+		NumberFormatInfo NumberFormat;
+		
+		NumberFormat = GetNumberFormat1();			
+		FormatStringTest ("DblFn1 #31", NumberFormat, 99999.9999996, "G67",
+"99999,999999599997");  
+		
+		FormatStringTest ("DblFn1 #63", NumberFormat, 1.79769313486231E+307,
+"E67",
+"1,7976931348623100000000000000000000000000000000000000000000000000000E+307");
+ 
+		FormatStringTest ("DblFn1 #63", NumberFormat, 1.79769313486231E+307,
+"E67",
+"1,7976931348623100000000000000000000000000000000000000000000000000000E+307");
+ 
+		FormatStringTest ("DblFn1 #88", NumberFormat, 1.79769313486231E+307,
+"P",
+"1.797.693.134.862.310.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000,00000
+%");  
+		FormatStringTest ("DblFn1 #89", NumberFormat, 1.79769313486231E+307,
+"P0",
+"1.797.693.134.862.310.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000
+%");  
+			FormatStringTest ("DblFn1 #90", NumberFormat,
+1.79769313486231E+307, "P1",
+"1.797.693.134.862.310.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000,0
+%");   
+	}
+}
+
+
+
+
+
+