8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74fc261 commit 7eb6b32Copy full SHA for 7eb6b32
src/sprintf.js
@@ -1,7 +1,8 @@
1
/**
2
- * sprintf() for JavaScript v.0.3
+ * sprintf() for JavaScript v.0.4
3
*
4
* Copyright (c) 2007 Alexandru Marasteanu <http://alexei.417.ro/>
5
+ * Thanks to David Baird (unit test and patch).
6
7
* This program is free software; you can redistribute it and/or modify it under
8
* the terms of the GNU General Public License as published by the Free Software
@@ -43,7 +44,7 @@ function sprintf () {
43
44
}
45
a = (/[def]/.test(m[7]) && m[2] && a > 0 ? '+' + a : a);
46
c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' ';
- x = m[6] ? m[5] - String(a).length : m[5];
47
+ x = m[5] - String(a).length;
48
p = m[5] ? str_repeat(c, x) : '';
49
o.push(m[4] ? a + p : p + a);
50
0 commit comments