1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00
Oinktube/node_modules/date-fns/_lib/getRoundingMethod.js
2025-07-10 15:28:42 -03:00

8 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;
};
}