[Console > Module area graph] Now the Y legend values are rounded properly to 2 dec when 'Shortened module graph data' is enabled

This commit is contained in:
Alejandro Gallardo Escobar 2017-11-27 11:56:52 +01:00
parent 3bc4bdb798
commit b431f4afd3
1 changed files with 2 additions and 7 deletions

View File

@ -2158,9 +2158,8 @@ function number_format(number, force_integer, unit) {
} }
} }
else { else {
var decimals = 2; // Round to 2 decimals
var factor = 10 * decimals; number = Math.round(number * 100) / 100;
number = Math.round(number*factor)/factor;
} }
var shorts = ["", "K", "M", "G", "T", "P", "E", "Z", "Y"]; var shorts = ["", "K", "M", "G", "T", "P", "E", "Z", "Y"];
@ -2174,10 +2173,6 @@ function number_format(number, force_integer, unit) {
pos++; pos++;
number = number / 1000; number = number / 1000;
} }
else if (number <= -1000) {
pos++;
number = number / 1000;
}
else { else {
break; break;
} }