Files
Gemini-Search/node_modules/date-fns/_lib/getRoundingMethod.mjs
Ammaar Reshi d6025af146 Initial commit
2025-01-04 14:06:53 +00:00

9 lines
229 B
JavaScript

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