Is there a way to reduce decimal places in JavaScript and get a number output in one step?

19 Views Asked by At

I'm a beginner in Javascript. I know the command .toFixed() reduces the decimal places after the comma to the number you write in parenthesis. However, this command turns the number into a string, and so if we wanted to use that information as a number we'd need to use Number() to turn that into a number.

Is there a command in JS that reduces the decimal places after the comma already returning a number value to us all in only one step?

Many thanks

0

There are 0 best solutions below