Issue
I have a variable with a result that looks like this:
myresult = 14.4565576
I need to round the decimal after the DOT to only 3 numbers.
For example I need to round this:
14.4565576
to this:
14.456
How can I do this?
Solution
You can use the toFixed method
const number = 14.4565576
console.log(number.toFixed(3))
Answered By - RenaudC5
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.