code: function padRight(x, padding) {
    if (x) {
      x += '';
    } else {
      x = '';
    }
    var buf = [];
    while (buf.length + x.length < padding) {
      buf.push('0');
    }
    return x + buf.join('');
  }
docs: where x is the decimals part of the number