summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/catapult/third_party/polymer2/bower_components/moment/src/lib/utils/zero-fill.js
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/catapult/third_party/polymer2/bower_components/moment/src/lib/utils/zero-fill.js')
-rw-r--r--chromium/third_party/catapult/third_party/polymer2/bower_components/moment/src/lib/utils/zero-fill.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/chromium/third_party/catapult/third_party/polymer2/bower_components/moment/src/lib/utils/zero-fill.js b/chromium/third_party/catapult/third_party/polymer2/bower_components/moment/src/lib/utils/zero-fill.js
new file mode 100644
index 00000000000..7009ec903d3
--- /dev/null
+++ b/chromium/third_party/catapult/third_party/polymer2/bower_components/moment/src/lib/utils/zero-fill.js
@@ -0,0 +1,7 @@
+export default function zeroFill(number, targetLength, forceSign) {
+ var absNumber = '' + Math.abs(number),
+ zerosToFill = targetLength - absNumber.length,
+ sign = number >= 0;
+ return (sign ? (forceSign ? '+' : '') : '-') +
+ Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
+}