From 98037ca0c65614dcda57a41a6b6b0364e58e4cb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 11 Nov 2014 14:55:23 +0100 Subject: [PATCH] SinglestatPanel: fixed issue when value is zero, #1039 --- src/app/panels/singlestat/module.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/panels/singlestat/module.js b/src/app/panels/singlestat/module.js index 1c1c2a3d0bb..93c6b67f242 100644 --- a/src/app/panels/singlestat/module.js +++ b/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);