| #846 | |
| #847 | public function metric_delta($current, $previous) { |
| #848 | $current = floatval($current); |
| #849 | $previous = floatval($previous); |
| #850 | if($previous == 0) { |
| #851 | return $current == 0 ? '0%' : '+100%'; |
| #852 | } |
| #853 | $delta = round(($current - $previous) / $previous * 100, 2); |
| #854 | return ($delta > 0 ? '+' : '').$delta.'%'; |
| #855 | } |