mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-27 03:10:32 -06:00
More rounding.
This commit is contained in:
parent
7895d7f5d0
commit
ac299e7279
@ -228,7 +228,7 @@ class PiggybankController extends BaseController
|
||||
*/
|
||||
public function postAdd(Piggybank $piggybank)
|
||||
{
|
||||
$amount = floatval(Input::get('amount'));
|
||||
$amount = round(floatval(Input::get('amount')), 2);
|
||||
|
||||
/** @var \FireflyIII\Database\Piggybank $acct */
|
||||
$repos = App::make('FireflyIII\Database\Piggybank');
|
||||
@ -236,7 +236,7 @@ class PiggybankController extends BaseController
|
||||
$leftOnAccount = $repos->leftOnAccount($piggybank->account);
|
||||
$savedSoFar = $piggybank->currentRelevantRep()->currentamount;
|
||||
$leftToSave = $piggybank->targetamount - $savedSoFar;
|
||||
$maxAmount = min($leftOnAccount, $leftToSave);
|
||||
$maxAmount = round(min($leftOnAccount, $leftToSave), 2);
|
||||
|
||||
if ($amount <= $maxAmount) {
|
||||
$repetition = $piggybank->currentRelevantRep();
|
||||
|
Loading…
Reference in New Issue
Block a user