[Mono-bugs] [Bug 666515] Double Parse and TryParse ignores regional settings under Mono
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Mon Feb 14 02:47:49 EST 2011
https://bugzilla.novell.com/show_bug.cgi?id=666515
https://bugzilla.novell.com/show_bug.cgi?id=666515#c4
Yakov Danilov <ydanila at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ydanila at gmail.com
--- Comment #4 from Yakov Danilov <ydanila at gmail.com> 2011-02-14 07:47:49 UTC ---
(In reply to comment #2)
> 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);
This exaple returns correct result
result == 5
--
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