Skip to content

Commit

Permalink
Fix percentage change condition
Browse files Browse the repository at this point in the history
  • Loading branch information
taiwo-ladipo committed Oct 24, 2018
1 parent 36d6490 commit 7ef7602
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/widgets/PeriodicCountWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public function init()

protected function renderBody()
{

$latestData = array_pop($this->data);
$count = ArrayHelper::getValue($latestData, 'count', 0);
$percentageChange = ArrayHelper::getValue($latestData, 'percentage_change', 0);
Expand Down Expand Up @@ -68,12 +67,12 @@ private function getValueWithIcon($value)
{
if ($value > 0) {
return '<span class = "text-success">
<span class = "fa fa-caret-up"></span>' . ' ' . number_format($value, 2) . '% ' .
'</span>';
} elseif ($value > 0) {
<span class = "fa fa-caret-up"></span>' . ' ' . number_format($value, 2) . '% ' .
'</span>';
} elseif ($value < 0) {
return '<span class = "text-danger">
<span class = "fa fa-caret-down"></span>' . ' ' . number_format($value, 2) . '% ' .
'</span>';
<span class = "fa fa-caret-down"></span>' . ' ' . number_format($value, 2) . '% ' .
'</span>';
}
return '<span class = "text-muted">' . $value . ' ' . '</span>';
}
Expand Down

0 comments on commit 7ef7602

Please sign in to comment.