On Fri, 06 Jul 2007 01:48:13 -0700, <Ni****************@googlemail.com
wrote:
When i try it like you say, he ignores the dot.
For example
s = "12.45";
d = double.Parse(s);
d will be 1245.0 :(
What are your culture settings? Clearly, parsing "12.45" as a double
would normally work in the context of a US-configured computer. I will
hazard a guess that you're using the comma for the decimal separator, and
the period for the thousands separator. If that's the case, then you need
to parse "12,45" if you expect to have a value returned that is twelve and
forty-five hundredths.
There are overloads for the Parse() method that take culture-specific
format providers, so if you know the string is from a specific culture
that may be different from what the user has configured, you can use those
to ensure correct conversion.
Pete