From 3e10c76bc71a3519cf613e74c62f7b907ccebf0a Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 1 Jan 2018 11:15:49 +0200 Subject: [PATCH] Fix comma in expense amount --- app/Http/Requests/CreateExpenseRequest.php | 4 +--- app/Http/Requests/UpdateExpenseRequest.php | 4 +--- resources/views/expenses/edit.blade.php | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/Http/Requests/CreateExpenseRequest.php b/app/Http/Requests/CreateExpenseRequest.php index 785390f2388d..a4983e2652e0 100644 --- a/app/Http/Requests/CreateExpenseRequest.php +++ b/app/Http/Requests/CreateExpenseRequest.php @@ -23,8 +23,6 @@ class CreateExpenseRequest extends ExpenseRequest */ public function rules() { - return [ - 'amount' => 'numeric', - ]; + return []; } } diff --git a/app/Http/Requests/UpdateExpenseRequest.php b/app/Http/Requests/UpdateExpenseRequest.php index 65fdc93752cb..97616adc626e 100644 --- a/app/Http/Requests/UpdateExpenseRequest.php +++ b/app/Http/Requests/UpdateExpenseRequest.php @@ -21,8 +21,6 @@ class UpdateExpenseRequest extends ExpenseRequest */ public function rules() { - return [ - 'amount' => 'numeric', - ]; + return []; } } diff --git a/resources/views/expenses/edit.blade.php b/resources/views/expenses/edit.blade.php index 5a04d4766a8b..9fbd6398104c 100644 --- a/resources/views/expenses/edit.blade.php +++ b/resources/views/expenses/edit.blade.php @@ -479,7 +479,7 @@ write: function(value) { // When changing the converted amount we're updating // the exchange rate rather than change the amount - self.exchange_rate(NINJA.parseFloat(value) / self.amount()); + self.exchange_rate(roundSignificant(NINJA.parseFloat(value) / self.amount())); //self.amount(roundToTwo(value / self.exchange_rate())); } }, self);