From 00effcf79d2f17496dba8165a10bf3b7997af8ef Mon Sep 17 00:00:00 2001 From: o-psi Date: Fri, 13 Oct 2023 17:39:41 -0500 Subject: [PATCH 1/2] remove commas before trying to make a float --- post/expense.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/post/expense.php b/post/expense.php index 1881861a..bac1244f 100644 --- a/post/expense.php +++ b/post/expense.php @@ -166,7 +166,7 @@ if (isset($_POST['create_recurring_expense'])) { $frequency = intval($_POST['frequency']); $day = intval($_POST['day']); $month = intval($_POST['month']); - $amount = floatval($_POST['amount']); + $amount = floatval(str_replace(',', '', $_POST['amount'])); $account = intval($_POST['account']); $vendor = intval($_POST['vendor']); $client = intval($_POST['client']); @@ -195,7 +195,7 @@ if (isset($_POST['edit_recurring_expense'])) { $frequency = intval($_POST['frequency']); $day = intval($_POST['day']); $month = intval($_POST['month']); - $amount = floatval($_POST['amount']); + $amount = floatval(str_replace(',', '', $_POST['amount'])); $account = intval($_POST['account']); $vendor = intval($_POST['vendor']); $client = intval($_POST['client']); From 3124ca27775db390c192763175db3b08b393945c Mon Sep 17 00:00:00 2001 From: o-psi Date: Fri, 13 Oct 2023 17:40:06 -0500 Subject: [PATCH 2/2] adjust regedit to allow for commas as thousands --- recurring_expense_create_modal.php | 2 +- recurring_expense_edit_modal.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/recurring_expense_create_modal.php b/recurring_expense_create_modal.php index 11645938..b3b9be43 100644 --- a/recurring_expense_create_modal.php +++ b/recurring_expense_create_modal.php @@ -68,7 +68,7 @@
- + diff --git a/recurring_expense_edit_modal.php b/recurring_expense_edit_modal.php index 8ec85ca5..48b5fc85 100644 --- a/recurring_expense_edit_modal.php +++ b/recurring_expense_edit_modal.php @@ -63,17 +63,15 @@
-
- +
-