Explorar el Código

SinglestatPanel: fixed issue when value is zero, #1039

Torkel Ödegaard hace 11 años
padre
commit
98037ca0c6
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/app/panels/singlestat/module.js

+ 3 - 0
src/app/panels/singlestat/module.js

@@ -124,6 +124,9 @@ function (angular, app, _, TimeSeries, kbn, PanelMeta) {
 
     $scope.getDecimalsForValue = function(value) {
       var opts = {};
+      if (value === 0) {
+        return { decimals: 0, scaledDecimals: 0 };
+      }
 
       var delta = value / 2;
       var dec = -Math.floor(Math.log(delta) / Math.LN10);