diff options
author | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-08-25 01:30:20 +0400 |
---|---|---|
committer | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-08-25 01:30:41 +0400 |
commit | 9638e3225de02fa0c69bc6fbfe8523f73c6306ee (patch) | |
tree | 4aa2d9caecbab8650573a2c22af47504478f70d4 /core/DataTable/Filter/CalculateEvolutionFilter.php | |
parent | fb1d4eb8e7398360ee37c8f09929877c8e2174a4 (diff) |
Refs #4077, add ability for treemap to color nodes based on evolution of metric since last period.
Notes:
- Added some utility functions to ColorManager JS class.
- Refactored some existing code in TreemapDataTable JS class.
Diffstat (limited to 'core/DataTable/Filter/CalculateEvolutionFilter.php')
-rwxr-xr-x | core/DataTable/Filter/CalculateEvolutionFilter.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/DataTable/Filter/CalculateEvolutionFilter.php b/core/DataTable/Filter/CalculateEvolutionFilter.php index ec39aa7d08..68d26b33d4 100755 --- a/core/DataTable/Filter/CalculateEvolutionFilter.php +++ b/core/DataTable/Filter/CalculateEvolutionFilter.php @@ -141,13 +141,16 @@ class CalculateEvolutionFilter extends ColumnCallbackAddColumnPercentage * @param float|int $pastValue The value of the metric in the past. We measure the % change * from this value to $currentValue. * @param float|int $quotientPrecision The quotient precision to round to. + * @param bool $appendPercentSign Whether to append a '%' sign to the end of the number or not. * * @return string The evolution percent 15% */ - public static function calculate($currentValue, $pastValue, $quotientPrecision = 0) + public static function calculate($currentValue, $pastValue, $quotientPrecision = 0, $appendPercentSign = true) { $number = self::getPercentageValue($currentValue - $pastValue, $pastValue, $quotientPrecision); - $number = self::appendPercentSign($number); + if ($appendPercentSign) { + $number = self::appendPercentSign($number); + } return $number; } |