Jquery - SEM number rounding

1

How can I leave the result of an account with the entire result, no rounding , that is every time jQuery runs the script it returns a value and each browser rounds it in its own way.

I want a way to leave the whole value without rounding for all browsers as in the example:

This is the real value:

933 / 9 = 103.66666666666666666666666666667

In the browser:

933 / 9 = 103.766

    
asked by anonymous 01.02.2017 / 12:22

1 answer

0

One option would be to force the number of decimal places with toFixed :

var num = (933 / 9).toFixed(20); // 103.66666666666667140362
    
01.02.2017 / 12:31