Skip to content

Commit

Permalink
Format target value as a number with reasonable default (#4073)
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr authored Aug 15, 2019
1 parent 0e90b89 commit 24d6800
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/app/visualizations/counter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,13 @@ const CounterRenderer = {
$scope.targetValueTooltip = formatTooltip($scope.targetValue, options.tooltipFormat);

$scope.counterValue = formatValue($scope.counterValue, options);

if (options.formatTargetValue) {
$scope.targetValue = formatValue($scope.targetValue, options);
} else {
if (Number.isFinite($scope.targetValue)) {
$scope.targetValue = numeral($scope.targetValue).format('0[.]00[0]');
}
}
}

Expand Down

0 comments on commit 24d6800

Please sign in to comment.