nci/lib/utils.js

17 lines
345 B
JavaScript
Raw Normal View History

2014-12-02 21:21:07 +00:00
'use strict';
2015-10-15 22:52:23 +00:00
var _ = require('underscore'),
sharedUtils = require('../static/js/shared/utils');
2015-05-07 19:03:57 +00:00
2015-10-15 22:52:23 +00:00
_(exports).extend(sharedUtils);
2015-10-03 14:14:41 +00:00
exports.lpad = function(str, length, chr) {
chr = chr || '0';
while (str.length < length) str = chr + str;
return str;
};
exports.toNumberStr = function(number) {
return exports.lpad(String(number), 20);
};