When I try this line:
float f = float.Parse(val, System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowThousands);
Parse is culture aware. If your local culture has different requirements, then you may want to pass a culture or other format provider in. Try using CultureInfo.InvariantCulture. You won't need the decimal option if you do.
float f = float.Parse(val,
System.Globalization.NumberStyles.AllowThousands,
CultureInfo.InvariantCulture);