diff options
author | Ranger Harke <ranger.harke@autodesk.com> | 2013-09-19 16:03:15 -0400 |
---|---|---|
committer | Ranger Harke <ranger.harke@autodesk.com> | 2013-09-19 16:03:15 -0400 |
commit | e4678bed92f20ea0b5cd6fa2467cc2b0444511e0 (patch) | |
tree | acc9652cb675f76a8a1d1e1d37241beeea3e2251 /src/library.js | |
parent | 45f8f9c948c5548665438827e3d6b39a40eca06e (diff) |
Fix bug with zero-padded negative integers
The zero padding was before the sign. It should be after.
Diffstat (limited to 'src/library.js')
-rw-r--r-- | src/library.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js index 5c2c858d..0aaef0b2 100644 --- a/src/library.js +++ b/src/library.js @@ -2166,6 +2166,12 @@ LibraryManager.library = { } } + // Move sign to prefix so we zero-pad after the sign + if (argText.charAt(0) == '-') { + prefix = '-' + prefix; + argText = argText.substr(1); + } + // Add padding. while (prefix.length + argText.length < width) { if (flagLeftAlign) { |