I want the exact 2 digits after the decimal point. I tried the toFixed(2) function but it returns rounded off 2 digits. Here is my Code it returns 18.70 but I want 18.69extract number
rim_weight = (23* 36 *70);
rim_weight = rim_weight/3100; // retuns 18.69677419354839
rim_weight = rim_weight.toFixed(2); // returns 18.70
If you just want to truncate the number to two decimal places, first divide by 31, convert to an integral value using
Math.floorand then divide by 100: