I am having a problem with dataformatting in SQL, C#, Razor and HTML5
In my database is a field which has to represent a currency, however the datatype is decimal(18,2), every value saved to the database is saved with an decimal point.
In my DTO the type is also decimal.
However when i give the EditorFor the type number, the field is null when it loads the page. When i give the EditorFor the type money, the field is filled with the correct value, however it places an comma instead of an decimal point which let it kick in an validation error when the form submits. I have to manually change the comma to an decimal point for it to correctly submit.
I have allready tried setting the type of the EditorFor to number and setting the step property but then it still keeps my input empty.
This is the record in the database
This is the record in my view
this is the generated html markup
UPDATE: I changed the globalization settings to en-US, this fixed the comma to decimal point question but screws up my date annotation, so down the line i'd like the data annotation to be nl-NL (or similar) and the number format to be en-US (or similar)
Note: it is not allowed to make any changes to the database regarding data-types.
Note: debugging is done on Google Chrome and Microsoft Edge