Explorar o código

Fixed fixed decimal option bug, when fixed decimal value was set to zero, Fixes #1764

Torkel Ödegaard %!s(int64=10) %!d(string=hai) anos
pai
achega
2bb85d216e

+ 1 - 1
public/app/panels/graph/graph.js

@@ -115,7 +115,7 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
             var formater = kbn.valueFormats[scope.panel.y_formats[series.yaxis - 1]];
             var formater = kbn.valueFormats[scope.panel.y_formats[series.yaxis - 1]];
 
 
             // decimal override
             // decimal override
-            if (scope.panel.decimals) {
+            if (_.isNumber(scope.panel.decimals)) {
               series.updateLegendValues(formater, scope.panel.decimals, null);
               series.updateLegendValues(formater, scope.panel.decimals, null);
             } else {
             } else {
               // auto decimals
               // auto decimals

+ 1 - 1
public/app/panels/singlestat/module.js

@@ -129,7 +129,7 @@ function (angular, app, _, TimeSeries, kbn, PanelMeta) {
     };
     };
 
 
     $scope.getDecimalsForValue = function(value) {
     $scope.getDecimalsForValue = function(value) {
-      if ($scope.panel.decimals) {
+      if (_.isNumber($scope.panel.decimals)) {
         return { decimals: $scope.panel.decimals, scaledDecimals: null };
         return { decimals: $scope.panel.decimals, scaledDecimals: null };
       }
       }