string.js 272 B

1234567891011121314
  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. };