I have an issue with the submitted form information. Decimal parsing fails when I try to parse a string returned through Interner Explorer or Chrome but not on Firefox or Safari. The strings looks exactly the same in Visual Studio. I made this debugging bit:
var asd3 = collection["formValue"]; // Get it from the FormCollection
var asd4 = asd3.Replace(",", "."); // Change the punctuation
var asd5 = Decimal.Parse(asd4); // Make the string into a decimal
var asd6 = Math.Round(asd5, 1); // Round it
It fails on asd5 when trying to parse the decimal out of asd4 with the error: Input string was not in a correct format.
Here’s an image of the strings. Top is Firefox and below Internet Explorer.

What on earth could be the problem here?
Culture.
In your debugger inspect the value of
Thread.CurrentThread.CurrentCultureand you will see differences between your browsers.If you have a different culture set in your browser this culture will be used by ASP.NET when parsing values especially if you haven’t explicitly specified the culture in your web.config:
If this is set to
autothen the browser culture will be used.Another possibility is to force invariant culture when parsing to ensure that
.(dot) will be the decimal separator.