how to get sum of float digits in js upto 2 digits code example Example: javascript convert int to float with 2 decimal places float_num.toFixed(2);