Home > OS >  Send Decimal number from HTML but as Integer on MVC C# ,ASP Net
Send Decimal number from HTML but as Integer on MVC C# ,ASP Net

Time:06-13

I'm trying to send a decimal number from html to c# via a form, but it gets caught as an integer.does anyone know why that is?

CodePudding user response:

Without all the details, I would check two things:

  1. The model so that it matches
  2. Check to see if I'm taking into account Culture relevant details. In some countries the dot (.) that separates the decimals is not the same. Some cultures use comma (,) to separate decimals and thus, you'll get the integer value, as the default culture fallback.
  • Related