I am implementing an Hybrid mobile application in which I have to represent our Desktop application written in C#.
When rounding off a value, the value differs between Desktop and Mobile application.
Example
Code used in C#:
Math.Round (7060.625, 2); // prints 7060.62
Math.Round (7060.624, 2); // prints 7060.62
Math.Round (7060.626, 2); // prints 7060.63
Code used in JS:
+(7060.625).toFixed(2); // prints 7060.63 (value differs)
+(7060.624).toFixed(2); // prints 7060.62
+(7060.626).toFixed(2); // prints 7060.63
How can I change the JS code to represent the value as in C#.
Note:
We can make C# to represent the value as in JS, using Math.Round (7060.625, 2, MidpointRounding.AwayFromZero);
But I have no option to change in there.
EDIT 1
Rounding off decimals is not fixed. It is chosen by user in mobile application.