Skip to content

Commit 24d6800

Browse files
authored
Format target value as a number with reasonable default (#4073)
1 parent 0e90b89 commit 24d6800

File tree

1 file changed

+5
-0
lines changed
  • client/app/visualizations/counter

1 file changed

+5
-0
lines changed

client/app/visualizations/counter/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,13 @@ const CounterRenderer = {
145145
$scope.targetValueTooltip = formatTooltip($scope.targetValue, options.tooltipFormat);
146146

147147
$scope.counterValue = formatValue($scope.counterValue, options);
148+
148149
if (options.formatTargetValue) {
149150
$scope.targetValue = formatValue($scope.targetValue, options);
151+
} else {
152+
if (Number.isFinite($scope.targetValue)) {
153+
$scope.targetValue = numeral($scope.targetValue).format('0[.]00[0]');
154+
}
150155
}
151156
}
152157

0 commit comments

Comments
 (0)