I want to round a number in JavaScript but to 2 decimal places but only if necessary.
For example 4.5 to be 4.50 and 3.331 to be 3.331.
I have tried using Math.round(number / 100) * 100 but when number is 4.5 it gives me 4.5 and I want it to be 4.50.
I have tried using .toFixed(2), but when number is 3.331 it will fix it to 3.33.
Any help is much appreciated.