Commits

Paul Pritchard  committed f3f970a

Fix #726 - Bug in sprintf %p, sometimes it outputs exponential form rather than decimal
Fix #529 - Scientific notation on label values ending in 0

  • Participants
  • Parent commits acd705b

Comments (0)

Files changed (1)

File src/jqplot.sprintf.js

                 var prefix = number < 0 ? '-' : positivePrefix;
 
                 var parts = String(Number(Math.abs(number)).toExponential()).split(/e|E/);
-                var sd = (parts[0].indexOf('.') != -1) ? parts[0].length - 1 : parts[0].length;
+                var sd = (parts[0].indexOf('.') != -1) ? parts[0].length - 1 : String(number).length;
                 var zeros = (parts[1] < 0) ? -parts[1] - 1 : 0;
                 
                 if (Math.abs(number) < 1) {