From 601fe6834679986fce4da48f8430307d679b1172 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 23 May 2015 17:14:36 +0200 Subject: [PATCH] Don't multiply transactions. --- app/Models/Transaction.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index 8ff5b1cd6c..21fe942337 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -45,8 +45,7 @@ class Transaction extends Model if (is_null($this->amount_encrypted)) { return $value; } - $value = intval(Crypt::decrypt($this->amount_encrypted)); - $value = $value / 100; + $value = floatval(Crypt::decrypt($this->amount_encrypted)); return $value; } @@ -87,9 +86,8 @@ class Transaction extends Model public function setAmountAttribute($value) { // save in cents: - $value = intval($value * 100); $this->attributes['amount_encrypted'] = Crypt::encrypt($value); - $this->attributes['amount'] = ($value / 100); + $this->attributes['amount'] = $value; } /**