aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/date-fns/_lib/addLeadingZeros/index.js
blob: ead95373b58450859a8f6ffce16e848eb20f04e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = addLeadingZeros;
function addLeadingZeros(number, targetLength) {
  var sign = number < 0 ? '-' : '';
  var output = Math.abs(number).toString();
  while (output.length < targetLength) {
    output = '0' + output;
  }
  return sign + output;
}
module.exports = exports.default;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage