the-tip-top-backend/node_modules/date-fns/_lib/getRoundingMethod.cjs
2025-11-17 23:47:54 +01:00

12 lines
284 B
JavaScript

"use strict";
exports.getRoundingMethod = getRoundingMethod;
function getRoundingMethod(method) {
return (number) => {
const round = method ? Math[method] : Math.trunc;
const result = round(number);
// Prevent negative zero
return result === 0 ? 0 : result;
};
}