Open this example in the interactive library
Source code
const cents = [1299, 500, 249];
console.log((cents.reduce((a, b) => a + b, 0) / 100).toFixed(2));
Sample output
20.48

Open this example in the interactive library
const cents = [1299, 500, 249];
console.log((cents.reduce((a, b) => a + b, 0) / 100).toFixed(2));
20.48