[Mono-bugs] [Bug 72657][Wis] New - Decimal ToString("C") outputs commas in the wrong place for en_GB

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 16 Feb 2005 17:14: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 edmund@greenius.ltd.uk.

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

--- shadow/72657	2005-02-16 17:14:27.000000000 -0500
+++ shadow/72657.tmp.15971	2005-02-16 17:14:27.000000000 -0500
@@ -0,0 +1,68 @@
+Bug#: 72657
+Product: Mono: Class Libraries
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: edmund@greenius.ltd.uk               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Decimal ToString("C")  outputs commas in the wrong place for en_GB
+
+Description of Problem:
+
+Decimal has incorrect string representation when formatted as currency with
+en_GB language - numbers are grouped in blocks of 4 instead of 3 between
+comma seperators.
+
+Example code:
+
+using System;
+public class TextFormattingProblem
+{
+  public static void Main(String[] args)
+  {
+    decimal valDecimal = 1234567890123.4567m;;
+    double valDouble = (double) valDecimal;
+    Console.WriteLine("Expected output : {0,10:C}", valDouble);
+    Console.WriteLine(" Decimal output : {0,10:C}", valDecimal);
+  }
+}
+
+Steps to reproduce the problem:
+using the above example
+1. $ mcs TextFormattingProblem.cs
+2. $ export LANG=en_GB
+3. $ mono TextFormattingProblem.exe
+
+Actual Results:
+> Expected output : £1,234,567,890,123.46
+>  Decimal output : £1,2345,6789,0123.46
+
+Expected Results:
+> Expected output : £1,234,567,890,123.46
+>  Decimal output : £1,234,567,890,123.46
+
+How often does this happen? 
+Always
+
+Additional Information:
+
+This error does not occur for other locales which I've tried, such as "da"
+or "en_US"
+
+I am using gentoo's dev-dotnet/mono version 1.0.5-r3
+$ mono --version
+Mono JIT compiler version 1.0.5, (C) 2002-2004 Novell, Inc and
+Contributors. www.go-mono.com
+        TLS:           normal
+        GC:            Included Boehm (with typed GC)
+        SIGSEGV      : normal
+        Globalization: ICU