Browse Source

SinglestatPanel: fixed issue when value is zero, #1039

Torkel Ödegaard 11 years ago
parent
commit
98037ca0c6
1 changed files with 3 additions and 0 deletions
  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) {
     $scope.getDecimalsForValue = function(value) {
       var opts = {};
       var opts = {};
+      if (value === 0) {
+        return { decimals: 0, scaledDecimals: 0 };
+      }
 
 
       var delta = value / 2;
       var delta = value / 2;
       var dec = -Math.floor(Math.log(delta) / Math.LN10);
       var dec = -Math.floor(Math.log(delta) / Math.LN10);