[Mono-bugs] [Bug 666515] Double Parse and TryParse ignores regional settings under Mono

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Feb 13 13:43:26 EST 2011



Rodrigo Kumpera <rkumpera at novell.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |NEEDINFO
                 CC|                            |rkumpera at novell.com
       InfoProvider|                            |coolman9999 at mail.ru

--- Comment #2 from Rodrigo Kumpera <rkumpera at novell.com> 2011-02-13 18:43:25 UTC ---
I cannot reproduce the bug here. I changed the current culture to use ',' as
decimal separator and mono did the right thing.

So, please, check if mono is running with your local settings correctly (it
might not be detecting it correctly) or post a test case that shows the bug. 

I used the following piece of code to test it:

        var cur = Thread.CurrentThread.CurrentCulture;
        cur = (CultureInfo)cur.Clone ();

        NumberFormatInfo ninfo = new NumberFormatInfo ();
        ninfo.NumberDecimalSeparator = ",";
        cur.NumberFormat = ninfo;

        Thread.CurrentThread.CurrentCulture = cur;

        string strVal = "5,00";
        double result = double.Parse(strVal);
        Console.WriteLine (result);

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list