aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/date-fns/esm/_lib/roundingMethods/index.js
blob: 27912675ff8a1a4c039966da427fed59e7d031e0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
var roundingMap = {
  ceil: Math.ceil,
  round: Math.round,
  floor: Math.floor,
  trunc: function trunc(value) {
    return value < 0 ? Math.ceil(value) : Math.floor(value);
  } // Math.trunc is not supported by IE
};

var defaultRoundingMethod = 'trunc';
export function getRoundingMethod(method) {
  return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage