hi i have a string s=5.15
and i wand the 5.15 number of string to convert to doble number
i have try the
dob= Double.Parse(s);
but i get 515 the conversion does not get the decimal . (if i use , then ok the conversion can be done!)
is any way to create this with the . char

AlanRank #669 · 3.6K reputationPosted Sep 21, 2008, 10:10 AM EDT
It sounds like you're in a culture, George, which uses ',' as its decimal separator. To use '.' instead you can do this:
using System.Globalization;
// ...
string s = "5.15";
CultureInfo ci = new CultureInfo("en-US");
double dob = double.Parse(s, ci.NumberFormat);