Skip to content

Commit

Permalink
Format target value as a number with reasonable default (getredash#4073)
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr authored and harveyrendell committed Nov 14, 2019
1 parent 15bb8eb commit 1056dac
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 1056dac

Please sign in to comment.