3

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 2

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I have to set this up on the back end. And I need the point not to be taken as a separator.
0

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.

1 Comment

Thank. I made a comma as a delimiter. But if I use a dot, then it is ignored. Those. the number 1.1 transforms into 11. This is wrong

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.