mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-28 11:43:53 -06:00
Bugfix: Empty pre-filled value in auto-budgets
The auto-budget pre-filled is empty when the set amount is above 1000 (view /budgets/edit/X). The root cause was the function 'number_format' returning a string that cannot be casted to a float when the amount is above 1000, because of the thousands separator.
This commit is contained in:
parent
e316d9ce6d
commit
a9ee07b19a
@ -103,7 +103,7 @@ class EditController extends Controller
|
|||||||
];
|
];
|
||||||
if ($autoBudget) {
|
if ($autoBudget) {
|
||||||
$amount = $hasOldInput ? $request->old('auto_budget_amount') : $autoBudget->amount;
|
$amount = $hasOldInput ? $request->old('auto_budget_amount') : $autoBudget->amount;
|
||||||
$preFilled['auto_budget_amount'] = number_format((float)$amount, $autoBudget->transactionCurrency->decimal_places);
|
$preFilled['auto_budget_amount'] = number_format((float)$amount, $autoBudget->transactionCurrency->decimal_places, '.', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
|
Loading…
Reference in New Issue
Block a user