"```javascript function roundToDecimal(num, decimalPlaces) { return Number(num.toFixed(decimalPlaces)); }
This `roundToDecimal` function takes two parameters: `num` (the number to be rounded) and `decimalPlaces` (the number of decimal places to keep). It uses the `toFixed` method to round the number to the specified decimal places and then converts the result back to a number using `Number`."