Tidy numbers
Prices with two decimals, a random dice roll, turning "42" typed in a box into the number 42 — JavaScript's built-in Math object and number tools handle these.
Rounding
const price = 123.456; console.log(Math.round(price)); console.log(Math.floor(price)); console.log(Math.ceil(price)); console.log(price.toFixed(2)); console.log(Math.max(4, 9, 2), Math.min(4, 9, 2));