source:
frontend/node_modules/utila/lib/string.js
| Last change on this file was 9af201e, checked in by , 12 days ago | |
|---|---|
|
|
| File size: 272 bytes | |
| Line | |
|---|---|
| 1 | // Generated by CoffeeScript 1.6.3 |
| 2 | module.exports = { |
| 3 | pad: function(n, width, z) { |
| 4 | if (z == null) { |
| 5 | z = '0'; |
| 6 | } |
| 7 | n = n + ''; |
| 8 | if (n.length >= width) { |
| 9 | return n; |
| 10 | } else { |
| 11 | return new Array(width - n.length + 1).join(z) + n; |
| 12 | } |
| 13 | } |
| 14 | }; |
Note:
See TracBrowser
for help on using the repository browser.
