JavaScript as many other programming languages has real difficulties when it comes to rounding numbers on edge cases for floating numbers. TL;DR;Proper, elegant solution to round numbers in JavaScript using Number.EPSILON (MDN link) correction π€: const round = (num = 0, fractions = 0) => { const k = Math.pow(10, fractions)