I have some problems with globalization and floating points. Intresting thing is if i send data in en-GB and floating point is "." (dot) all seems looks fine
but when i change culture with coma "," then all going weird :)
Now in screen above u can see POST sending "0,07" but model give me "7". Any ideas how to fix this problem ?
Tx for answers and ideas :)
Be sure to set CurrentThread.CurrentCulture because that is the one used for parsing the number.
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_AcquireRequestState(object sender, EventArgs e)
{
var culture = CultureInfo.CreateSpecificCulture("pl-PL");
Thread.CurrentThread.CurrentUICulture = culture;
Thread.CurrentThread.CurrentCulture = culture;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With