0

I'm creating a form with a decimal field for a currency input.

This is what my HTML looks

<input asp-for="Valor" class="form-control" required autocomplete="Valor" type="number" step=".01" min="0.01" autofocus />

When i submit the form the field have the correct value:

https://i.stack.imgur.com/ETtmp.png

But when it reaches the set method of the object on the backend it's without the decimal separator

https://i.stack.imgur.com/rL2EC.png

what could i do to fix this?

Coder
  • 1
  • 1
    Does this answer your question? [How to set decimal separators in ASP.NET MVC controllers?](https://stackoverflow.com/questions/793459/how-to-set-decimal-separators-in-asp-net-mvc-controllers) – Progman Feb 20 '21 at 23:23
  • Yes i just needed to define in the culture on Startup.cs ` CultureInfo.NumberFormat.NumberDecimalSeparator = "."; ` – Coder Feb 20 '21 at 23:43

0 Answers0