I need to return double value in json format and limit count of numbers after coma to 6.
Ex: 12.310203
When number is 12.310203123123
I dont want to convert to string.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can change the MidpointRounding.AwayFromZero also. Feel free to view documentation here
You can also ignore that overload, and simply do:
Math.Round(12.310203123123, 6)if you dont care about the rounding.