mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-27 06:29:42 -08:00
ui changed, limit the number of digits for the larger units is 5
This commit is contained in:
parent
1eac566d09
commit
b1151bdabc
File diff suppressed because one or more lines are too long
|
@ -736,21 +736,21 @@ Prometheus.Graph.prototype.remove = function() {
|
||||||
Prometheus.Graph.prototype.formatKMBT = function(y) {
|
Prometheus.Graph.prototype.formatKMBT = function(y) {
|
||||||
var abs_y = Math.abs(y);
|
var abs_y = Math.abs(y);
|
||||||
if (abs_y >= 1e24) {
|
if (abs_y >= 1e24) {
|
||||||
return y / 1e24 + "Y";
|
return (y / 1e24).toFixed(5) + "Y";
|
||||||
} else if (abs_y >= 1e21) {
|
} else if (abs_y >= 1e21) {
|
||||||
return y / 1e21 + "Z";
|
return (y / 1e21).toFixed(5) + "Z";
|
||||||
} else if (abs_y >= 1e18) {
|
} else if (abs_y >= 1e18) {
|
||||||
return y / 1e18 + "E";
|
return (y / 1e18).toFixed(5) + "E";
|
||||||
} else if (abs_y >= 1e15) {
|
} else if (abs_y >= 1e15) {
|
||||||
return y / 1e15 + "P";
|
return (y / 1e15).toFixed(5) + "P";
|
||||||
} else if (abs_y >= 1e12) {
|
} else if (abs_y >= 1e12) {
|
||||||
return y / 1e12 + "T";
|
return (y / 1e12).toFixed(5) + "T";
|
||||||
} else if (abs_y >= 1e9) {
|
} else if (abs_y >= 1e9) {
|
||||||
return y / 1e9 + "G";
|
return (y / 1e9).toFixed(5) + "G";
|
||||||
} else if (abs_y >= 1e6) {
|
} else if (abs_y >= 1e6) {
|
||||||
return y / 1e6 + "M";
|
return (y / 1e6).toFixed(5) + "M";
|
||||||
} else if (abs_y >= 1e3) {
|
} else if (abs_y >= 1e3) {
|
||||||
return y / 1e3 + "k";
|
return (y / 1e3 + "k";
|
||||||
} else if (abs_y >= 1) {
|
} else if (abs_y >= 1) {
|
||||||
return y
|
return y
|
||||||
} else if (abs_y === 0) {
|
} else if (abs_y === 0) {
|
||||||
|
|
Loading…
Reference in a new issue