I want to round a decimal number with 4 digit(e.g 4.3333) Is there any code in javascript?
I tried the following code
var dec=round(4.3234323,4);
For rounding the number, you can use -
var num = 4.3234323;
parseFloat(Math.ceil( num * 10 ) / 10).toFixed(4)
OR you only want to take value at four decimal points then use - .toFixed(n)