Separator in current culture set as ",", but json data convert value with dot only. Also data controller return have dot as separator. How i can change it? I also want the comma to be invalid.
2 Answers
JSON is about data, not how that data should be displayed. Regardless of culture, in both C# and JavaScript, decimals use a period as the precision separator. As such, you'd either need to transfer the formatted value as plain string (in which case you have no validation), or the value in your JSON needs to conform with expected data format of C#/JavaScript. Client-side, you can format it to/from the correct culture display.
1 Comment
Since the Clients that use your API follow the JSON format . JSON seperate the decimal with the dot, so you are required to follow this rule. But if you need to do this with your culture Separator, you need to send this value as string.