One of my software's functions is to convert numeric strings into double
datatype. I want to explicitly indicate the use of period (.) as a decimal point. Thus, no matter the language settings of the user's system, it will correctly read a period-separated decimal. I believe the solution is to use the IFormatProvider
argument in the Convert.ToDouble()
function. I am unsure how to do this.
Example: String: "3.14" Double: 3.14
Use
CultureInfo.InvariantCulture
while parsing.See: CultureInfo.InvariantCulture Property