[Mono-bugs] [Bug 59890][Cos] Changed - Format error when writing to console

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 9 Jun 2004 17:05:58 -0400 (EDT)


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 tcabanski@oai.cc.

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

--- shadow/59890	2004-06-09 16:37:58.000000000 -0400
+++ shadow/59890.tmp.6770	2004-06-09 17:05:58.000000000 -0400
@@ -3,13 +3,13 @@
 Version: unspecified
 OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
 Severity: Unknown
-Priority: Major
+Priority: Cosmetic
 Component: CORLIB
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: tcabanski@oai.cc               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
@@ -28,6 +28,41 @@
 ------- Additional Comments From atsushi@ximian.com  2004-06-09 16:37 -------
 Please provide (1) your example code (since we cannot understand what
 you are printing to the console), and (2) your culture
 (Console.WriteLine
 (System.Globalization.CultureInfo.CurrentCulture.LCID + "," +
 System.Globalization.CultureInfo.CurrentCulture)).
+
+------- Additional Comments From tcabanski@oai.cc  2004-06-09 17:05 -------
+This is a greatly simplified example of code that will work under 
+Microsoft and fail under Mono.  The application has to force en-US 
+culture because the real-world output is used for data interchange.  
+Clearly, I was wrong about this being caused by Console.WriteLine 
+used in my diagnostic logging code; the error message is written to 
+the console but is caused by the formatting.
+
+using System;
+
+namespace MonoBug1
+{
+	/// <summary>
+	/// Summary description for Class1.
+	/// </summary>
+	class Class1
+	{
+		/// <summary>
+		/// The main entry point for the application.
+		/// </summary>
+		[STAThread]
+		static void Main(string[] args)
+		{
+			System.Globalization.CultureInfo 
+_usEnglishCultureInfo = new System.Globalization.CultureInfo("en-
+US");
+			double val = 100;
+			string s = val.ToString(".0################;-
+.0################;0.0", _usEnglishCultureInfo);
+			Console.WriteLine("Ready to Write");
+			Console.WriteLine(s);
+		}
+	}
+}