[Mono-bugs] [Bug 36278][Nor] New - DecimalFormatter does not add zeroes when they are required
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Fri, 3 Jan 2003 18:25:53 -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 yoros@wanadoo.es.
http://bugzilla.ximian.com/show_bug.cgi?id=36278
--- shadow/36278 Fri Jan 3 18:25:52 2003
+++ shadow/36278.tmp.10993 Fri Jan 3 18:25:53 2003
@@ -0,0 +1,58 @@
+Bug#: 36278
+Product: Mono/Class Libraries
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: yoros@wanadoo.es
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: DecimalFormatter does not add zeroes when they are required
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+
+Steps to reproduce the problem:
+1. Just compile and run a code with the line: Console.Write("{0:F5}",1.1);
+
+Actual Results:
+
+I get on the console: "1.1"
+
+
+Expected Results:
+
+There was expected: "1.10000"
+
+
+How often does this happen?
+
+Always
+
+
+Additional Information:
+
+I have a little code for add zeroes at the end and round the "double"
+number. It's very simple and would be optimized, but here is it:
+
+ public static string Formatea (double numero, int decimales) {
+ string Result = Convert.ToString(Math.Round(numero,decimales));
+ int i = Result.Length - Result.IndexOf(',') - 1;
+ for (; i < decimales; i++) {
+ Result = String.Concat(Result,"0");
+ }
+ return Result;
+ }
+
+--
+
+That's all.