I am trying to create a function that can take a number and the number of decimal places and round the number to the exact decimal places that are going to be given.
I am using parseInt(prompt())
in order to gave the number and the number of decimal places.
For example,
round(3.141519, 2) -> 3.14
round(5986.32456, 4) -> 5986.3246
Can someone help me with this?