Commit 5a5aed10 by Peter Holmberg

adding check for decimals

parent 94d129e4
...@@ -279,15 +279,17 @@ class SingleStatCtrl extends MetricsPanelCtrl { ...@@ -279,15 +279,17 @@ class SingleStatCtrl extends MetricsPanelCtrl {
data.value = this.series[0].stats[this.panel.valueName]; data.value = this.series[0].stats[this.panel.valueName];
data.flotpairs = this.series[0].flotpairs; data.flotpairs = this.series[0].flotpairs;
const decimalInfo = getDecimalsForValue(data.value); let decimals = this.panel.decimals;
let scaledDecimals = 0;
data.valueFormatted = formatFunc(
data.value, if (!this.panel.decimals) {
decimalInfo.decimals, const decimalInfo = getDecimalsForValue(data.value);
decimalInfo.scaledDecimals, decimals = decimalInfo.decimals;
this.dashboard.isTimezoneUtc() scaledDecimals = decimalInfo.scaledDecimals;
); }
data.valueRounded = kbn.roundValue(data.value, decimalInfo.decimals);
data.valueFormatted = formatFunc(data.value, decimals, scaledDecimals, this.dashboard.isTimezoneUtc());
data.valueRounded = kbn.roundValue(data.value, decimals);
} }
// Add $__name variable for using in prefix or postfix // Add $__name variable for using in prefix or postfix
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment