What is number parsing?
All numeric types have two static parsing methods, TryParse and Parse, those are used to convert the string representation of a number into a numeric type.
Difference between TryParse and Parse is that TryParse method returns false whereas, the Parse method throws and exception if operation fails.
string numberStringRep = "35.88";
double number = double.Parse(numberStringRep);
Formatting conventions of a particular culture is always used by the Parse operation. If culture is not specified by passing a CultureInfo or NumberFromatInfo object, the culture associated with the current thread is used.
NumberFormat.NumberDecimalSeparator property is used to find the decimal separator string used by a culture.
// Returns: "."
new CultureInfo("en").NumberFormat.NumberDecimalSeparator;
// Returns: ","
new CultureInfo("es").NumberFormat.NumberDecimalSeparator;
// Returns: "."
CultureInfo.InvariantCulture.NumberFormat.NumberDecimalSeparator;
// Returns: ""
CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;