aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
authorRanger Harke <ranger.harke@autodesk.com>2013-09-19 16:03:15 -0400
committerRanger Harke <ranger.harke@autodesk.com>2013-09-19 16:03:15 -0400
commite4678bed92f20ea0b5cd6fa2467cc2b0444511e0 (patch)
treeacc9652cb675f76a8a1d1e1d37241beeea3e2251 /src/library.js
parent45f8f9c948c5548665438827e3d6b39a40eca06e (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.js6
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) {