Fixed some math.

This commit is contained in:
James Cole
2015-05-24 08:00:40 +02:00
parent 724db6c34c
commit 288546c2b9
12 changed files with 64 additions and 218 deletions

View File

@@ -21,22 +21,6 @@ class BudgetLimit extends Model
return $this->belongsTo('FireflyIII\Models\Budget');
}
/**
* @param $value
*
* @return float|int
*/
public function getAmountAttribute($value)
{
// if (is_null($this->amount_encrypted)) {
// return $value;
// }
// $value = intval(Crypt::decrypt($this->amount_encrypted));
// $value = $value / 100;
return $value;
}
/**
* @return array
*/
@@ -58,11 +42,7 @@ class BudgetLimit 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'] = round($value, 2);
$this->attributes['amount'] = strval(round($value, 2));
}
}