Hi NG!
I have a little question about the localization of a double.
If I use the CultureInfo "en-US" I have the following behavior:
1.) If I enter the value 2.5 into a textbox the
double.Parse(text1.Text) returns 2.5 as expected.
2.) If I enter the value 2,5 into a textbox the
double.Parse(text1.Text) returns 25...why 25 and not 2500. The , is
the group-separator.
Is it possible to ignore these behavior to ensure the 2,5 and 2.5 will
always be interpreted as 2.5 9like in the calculator) ? Or do I have
to implement this behavior by my self?
Regards
Marcel
Michael S. Kaplan [MSFT] - 10 Sep 2007 01:46 GMT
There is no place I know of that treats the grouping separator as something
that implies missing zeros are there....
But in any case, the parsing behavior is designed to do culture-specific
formatting. If you want it to do something different then you have to parse
it yourself....

Signature
MichKa [Microsoft]
Fundamentals Technical Lead
Windows International
Blog: http://blogs.msdn.com/michkap
This posting is provided "AS IS" with
no warranties, and confers no rights.
> Hi NG!
> I have a little question about the localization of a double.
[quoted text clipped - 13 lines]
> Regards
> Marcel