diff --git a/.internal/createRound.js b/.internal/createRound.js index 8729aa958d..b520ba1343 100644 --- a/.internal/createRound.js +++ b/.internal/createRound.js @@ -8,7 +8,7 @@ function createRound(methodName) { const func = Math[methodName] return (number, precision) => { - precision = precision == null ? 0 : Math.min(precision, 292) + precision = precision == null ? 0 : (precision >= 0 ? Math.min(precision, 292) : Math.max(precision, -292)) if (precision) { // Shift with exponential notation to avoid floating-point issues. // See [MDN](https://mdn.io/round#Examples) for more details.