Blame view

天文台pc/tianwentai-ui/node_modules/date-fns/_lib/getRoundingMethod.js 284 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
  "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;
    };
  }