{"_id":"digits","_rev":"111927","name":"digits","description":"Pad numbers with zeros. Automatically pad the number of digits based on the length of the array, or explicitly pass in the number of digits to use.","dist-tags":{"latest":"0.2.0"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:43:51.000Z","created":"2013-12-08T15:15:27.265Z","0.2.0":"2014-12-05T13:13:31.356Z","0.1.4":"2014-01-22T23:03:43.688Z","0.1.3":"2014-01-15T06:50:14.664Z","0.1.2":"2013-12-09T17:08:56.042Z","0.1.1":"2013-12-09T14:34:00.310Z","0.1.0":"2013-12-08T15:15:27.265Z"},"users":{"tunnckocore":true,"jonschlinkert":true},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/digits.git"},"versions":{"0.2.0":{"name":"digits","description":"Pad numbers with zeros. Automatically pad the number of digits based on the length of the array, or explicitly pass in the number of digits to use.","version":"0.2.0","homepage":"https://github.com/jonschlinkert/digits","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/digits.git"},"bugs":{"url":"https://github.com/jonschlinkert/digits/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/digits/blob/master/LICENSE-MIT"},"main":"index.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha -R spec"},"dependencies":{"longest":"^0.2.1","pad-left":"^0.2.0"},"devDependencies":{"mocha":"*","should":"*"},"keywords":["amount","digit","digits","helper","mixin","number","pad","padded","padding"],"_id":"digits@0.2.0","_shasum":"79f7fe84fd2ad6a752bb9902e679a354cb10391f","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"79f7fe84fd2ad6a752bb9902e679a354cb10391f","size":3630,"noattachment":false,"key":"/digits/-/digits-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/digits/download/digits-0.2.0.tgz"},"directories":{},"publish_time":1417785211356,"_cnpm_publish_time":1417785211356,"_hasShrinkwrap":false},"0.1.4":{"name":"digits","description":" Pad numbers with zeros. Automatically pad the number of digits based on the length of the array, or explicitly pass in the number of digits to use.","version":"0.1.4","homepage":"https://github.com/jonschlinkert/digits","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/digits.git"},"bugs":{"url":"https://github.com/jonschlinkert/digits/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/digits/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">= 0.8.0"},"keywords":["grunt task","build","handlebars helper","underscore mixin","site generator","component generator","blog generator","handlebars","templates"],"_id":"digits@0.1.4","dist":{"shasum":"530f13a7703508ba026c165a82f0e68b0a23188c","size":2808,"noattachment":false,"key":"/digits/-/digits-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/digits/download/digits-0.1.4.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1390431823688,"_cnpm_publish_time":1390431823688,"_hasShrinkwrap":false},"0.1.3":{"name":"digits","description":" Pad numbers with zeros. Automatically pad the number of digits based on the length of the array, or explicitly pass in the number of digits to use.","version":"0.1.3","homepage":"https://github.com/jonschlinkert/digits","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/digits.git"},"bugs":{"url":"https://github.com/jonschlinkert/digits/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/digits/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">= 0.8.0"},"keywords":["grunt task","build","handlebars helper","underscore mixin","site generator","component generator","blog generator","handlebars","templates"],"readmeFilename":"README.md","_id":"digits@0.1.3","dist":{"shasum":"c030e984d6edca43d8e21b1f2fb73c9d405d6f1c","size":2709,"noattachment":false,"key":"/digits/-/digits-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/digits/download/digits-0.1.3.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1389768614664,"_cnpm_publish_time":1389768614664,"_hasShrinkwrap":false},"0.1.2":{"name":"digits","description":" Pad numbers with zeros. Automatically pad the number of digits based on the length of the array, or explicitly pass in the number of digits to use.","version":"0.1.2","homepage":"https://github.com/jonschlinkert/digits","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/digits.git"},"bugs":{"url":"https://github.com/jonschlinkert/digits/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/digits/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">= 0.8.0"},"keywords":["grunt task","build","handlebars helper","underscore mixin","site generator","component generator","blog generator","handlebars","templates"],"readmeFilename":"README.md","_id":"digits@0.1.2","dist":{"shasum":"c69d37310cd31617adb420e28ae77e9c08089f10","size":3085,"noattachment":false,"key":"/digits/-/digits-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/digits/download/digits-0.1.2.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1386608936042,"_cnpm_publish_time":1386608936042,"_hasShrinkwrap":false},"0.1.1":{"name":"digits","description":" Pad numbers with zeros. Automatically pad the number of digits based on the length of the array, or explicitly pass in the number of digits to use.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/digits","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/digits.git"},"bugs":{"url":"https://github.com/jonschlinkert/digits/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/digits/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">= 0.8.0"},"keywords":["grunt task","build","handlebars helper","underscore mixin","site generator","component generator","blog generator","handlebars","templates"],"readmeFilename":"README.md","_id":"digits@0.1.1","dist":{"shasum":"dd67da7d2b09af968eecff55b951d691902b0565","size":3090,"noattachment":false,"key":"/digits/-/digits-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/digits/download/digits-0.1.1.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1386599640310,"_cnpm_publish_time":1386599640310,"_hasShrinkwrap":false},"0.1.0":{"name":"digits","description":" Pad numbers with zeros. Automatically pad the number of digits based on the length of the array, or explicitly pass in the number of digits to use.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/digits","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/digits.git"},"bugs":{"url":"https://github.com/jonschlinkert/digits/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/digits/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">= 0.8.0"},"keywords":["grunt task","build","handlebars helper","underscore mixin","site generator","component generator","blog generator","handlebars","templates"],"readmeFilename":"README.md","_id":"digits@0.1.0","dist":{"shasum":"69c4948ef742e84a0899a24dc12b3ab90009c7b6","size":2724,"noattachment":false,"key":"/digits/-/digits-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/digits/download/digits-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1386515727265,"_cnpm_publish_time":1386515727265,"_hasShrinkwrap":false}},"readme":"# digits [![NPM version](https://badge.fury.io/js/digits.svg)](http://badge.fury.io/js/digits)\n\n> Pad numbers with zeros. Automatically pad the number of digits based on the length of the array, or explicitly pass in the number of digits to use.\n\n## Install with [npm](npmjs.org)\n\n```bash\nnpm i digits --save\n```\n\n## Run tests\n\n```bash\nnpm test\n```\n\n## Usage\n\n```js\nvar digits = require('digits');\n```\n\n## API\n### [digits](index.js#L37)\n\nLeft pad the given `value` with the specified `number` of zeros or alternate `character`.\n\n* `value` **{String}**    \n* `number` **{String}**    \n* `returns` **{String}** `character`  \n\n```js\ndigits('abc', 10);\n//=> '0000000000abc'\n\ndigits('abc', 10, '~');\n//=> '~~~~~~~~~~abc'\n```\n\n### [.each](index.js#L62)\n\nPad left pad each value in the given `array` to align with the longest item/number in the array. Zeros are used by default, but a custom `character` can be passed as the second argument.\n\n* `arr` **{Number}**: The array of values to pad.    \n* `len` **{Number}**: Amount to pad the number.    \n* `returns` **{String}**: Padded number  \n\n**Example**\n\n```js\ndigits.each([1, 100, 1000])\n//=> ['0001', '0100', '1000']\n\ndigits.each([a, bb, ccc], ' ')\n//=> ['  a', ' bb', 'ccc']\n```\n\n\n## Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/digits/issues)\n\n## Author\n\n**Jon Schlinkert**\n \n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) \n\n## License\nCopyright (c) 2014 Jon Schlinkert  \nReleased under the MIT license\n\n***\n\n_This file was generated by [verb](https://github.com/assemble/verb) on December 05, 2014. To update, run `npm i -g verb && verb`._\n","_attachments":{},"homepage":"https://github.com/jonschlinkert/digits","bugs":{"url":"https://github.com/jonschlinkert/digits/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/digits/blob/master/LICENSE-MIT"}}