Add percentage to piggy bank view.

This commit is contained in:
James Cole
2014-08-20 16:54:43 +02:00
parent 71504c76ac
commit c272d99fa8
2 changed files with 9 additions and 2 deletions

View File

@@ -50,6 +50,13 @@ class PiggybankRepetition extends Ardent
];
}
public function pct() {
$total = $this->piggybank->targetamount;
$saved = $this->currentamount;
$pct = round(($saved / $total) * 100,1);
return $pct;
}
/**
* @return array
*/