From 905ae3437bd8e071b1dcd68f9ae7667593a9fc97 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 8 Feb 2016 21:09:00 +0100 Subject: [PATCH] float > string. --- app/Http/Controllers/PiggyBankController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index a7ea7c006e..845c5f8e02 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -168,7 +168,7 @@ class PiggyBankController extends Controller /** @var Collection $piggyBanks */ $piggyBanks = $piggyRepository->getPiggyBanks(); /** @var Carbon $end */ - $end = session('end', Carbon::now()->endOfMonth()); + $end = session('end', Carbon::now()->endOfMonth()); bcscale(2); $accounts = []; @@ -229,7 +229,7 @@ class PiggyBankController extends Controller public function postAdd(PiggyBankRepositoryInterface $repository, ARI $accounts, PiggyBank $piggyBank) { bcscale(2); - $amount = round(Input::get('amount'), 2); + $amount = round(Input::get('amount'), 2); /** @var Carbon $date */ $date = session('end', Carbon::now()->endOfMonth()); $leftOnAccount = $accounts->leftOnAccount($piggyBank->account, $date); @@ -274,7 +274,7 @@ class PiggyBankController extends Controller $repetition->save(); // create event - $repository->createEvent($piggyBank, $amount * -1); + $repository->createEvent($piggyBank, bcmul($amount, '-1')); Session::flash('success', 'Removed ' . Amount::format($amount, false) . ' from "' . e($piggyBank->name) . '".'); Preferences::mark();