fix a regression in formatValue, concerning the number of decimals

This commit is contained in:
rlx 2012-03-27 09:36:11 +00:00
parent fb385a5e57
commit 97810bb472

View file

@ -546,7 +546,7 @@ Ox.formatValue = function(num, str, bin) {
val;
Ox.forEach(Ox.PREFIXES, function(chr, i) {
if (num < Math.pow(base, i + 1) || i == len - 1) {
val = Ox.formatNumber(num / Math.pow(base, i), i) +
val = Ox.formatNumber(num / Math.pow(base, i), i ? i - 1 : 0) +
' ' + chr + (chr && bin ? 'i' : '') + str;
return false;
}