44571.123 * 75.46 = 3363336.94158, But I want the value 3363336.942. So do i write code in java script
Asked
Active
Viewed 85 times
-4
-
1number.toFixed(numberOfDecimals) – martskins Nov 04 '14 at 12:05
-
`(44571.123 * 75.46).toFixed(3)` – Andy Nov 04 '14 at 12:07
-
1There's a manual you can read -> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed – Andy Nov 04 '14 at 12:08
1 Answers
0
You can use the toFixed() function like so:
var sum = (44571.123 * 75.46);
var decimal = sum.toFixed(3);
with 3 being the number of decimal places that you want.

Daniel Hutton
- 1,455
- 1
- 17
- 33