Format a number to a fixed number of decimal places. Pass in the number of decimal places as an argument.
var pi = 3.14159;
var eleven = 11;
// returns 3.14
pi.toFixed(2);
// returns 11.000
eleven.toFixed(3);
Source
https://vanillajstoolkit.com/reference/numbers/number-tofixed/