[Mono-bugs] [Bug 42312][Nor] New - Console.WriteLine(2.00.ToString("F2"); formatting incorrect.
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Sun, 4 May 2003 17:09:33 -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 bstrauss-ximian@feliscatus.org.
http://bugzilla.ximian.com/show_bug.cgi?id=42312
--- shadow/42312 Sun May 4 17:09:33 2003
+++ shadow/42312.tmp.20126 Sun May 4 17:09:33 2003
@@ -0,0 +1,65 @@
+Bug#: 42312
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Red Hat 8.0
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: bstrauss-ximian@feliscatus.org
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Console.WriteLine(2.00.ToString("F2"); formatting incorrect.
+
+Description of Problem:
+
+The output from the following line is incorrect:
+
+Console.WriteLine(2.00.ToString("F2");
+
+It outputs '2', when it should output '2.00' (two decimal digits).
+
+
+Steps to reproduce the problem:
+1. Create a mini test program
+
+using System;
+public class test {
+ public static void Main() {
+ Console.WriteLine(2.00.ToString("F2"));
+ }
+}
+
+2. Compile and run.
+
+Actual Results:
+
+2
+
+
+Expected Results:
+
+
+2.00
+
+How often does this happen?
+
+Every time
+
+Additional Information:
+
+(http://msdn.microsoft.com/library/default.asp?url=/library/en-
+us/cpguide/html/cpconstandardnumericformatstrings.asp)
+
+F or f Fixed-point
+
+The number is converted to a string of the form "-ddd.ddd..." where
+each 'd' indicates a digit (0-9). The string starts with a minus sign if
+the number is negative. The precision specifier indicates the desired
+number of decimal places. If the precision specifier is omitted, the
+default numeric precision given by the NumberFormatInfo is used.