As you know, because of the brilliant rounding rule in C# , we get the following values:
decimal d = 2.155M; var r = Math.Round(d, 2);
Now on the client side in Javascript I get:
2.155.toFixed(2) "2.15" 2.145.toFixed(2) "2.15" kendo.toString(2.155, 'n2') "2.16" kendo.toString(2.145, 'n2') "2.15"
But I have checks in the backend, which because of this does not work. What is the right way to deal with this situation? How can I synchronize the rounding of C# and Javascript to make sure they are both rounded to the same value?
source share