[Solved] ConvertToDouble returns an “integer” value


The culture on your machine probably does not consider the decimal seperator to be ‘.’ but ‘,’. Try with this:

Convert.ToDouble("168.255157", CultureInfo.InvariantCulture);

Edit: I confirmed that this was happening on my machine when I was using the wrong separator. This:

Convert.ToDouble("168,255157", CultureInfo.InvariantCulture);

also returned 168255157.0. You should always bear in mind the culture you are using when parsing strings.

1

solved ConvertToDouble returns an “integer” value