.toFixed() is best solution.It will keep only two digits after dot.
Exp 1:
var value = 3.666;
value.toFixed(2); //Output : 3.67
Exp 2:
var value = 3.0000;
value.toFixed(2); //Output : 3.00
.toFixed() is best solution.It will keep only two digits after dot.
Exp 1:
var value = 3.666;
value.toFixed(2); //Output : 3.67
Exp 2:
var value = 3.0000;
value.toFixed(2); //Output : 3.00