title: sprintf() for JavaScript that behaves like Python's format (%)?
body: <p>I need a JavaScript function (or jQuery plugin) for <code>printf</code>/<code>sprintf</code>. It needs to support named arguments (<code>"%(foo)s"</code>) and padding (<code>"%02d"</code>), <em>i.e.</em> the following format string should work:</p>
  
  <pre><code>"%(amount)s.%(subunits)02d"
  </code></pre>
  
  <p>It only needs to support <code>s</code> and <code>d</code>, I don't care about all the other format strings (e.g. <code>f</code>, <code>x</code>, etc.). I don't need padding for strings/<code>s</code>, just <code>d</code>, I only need simple padding for <code>d</code>, e.g. <code>%2d</code>, <code>%3d</code>, <code>%04d</code>, etc.</p>