fix: Format budget estimated income and spending with two decimal places

This commit is contained in:
Josh Pigford
2025-02-06 14:40:58 -06:00
parent 21dc4b80f3
commit 78e34d68e9

View File

@@ -32,8 +32,8 @@
<div class="relative inline-block select-none ml-6">
<%= check_box_tag :auto_fill, "1", params[:auto_fill].present?, class: "sr-only peer", data: {
action: "change->budget-form#toggleAutoFill",
budget_form_income_param: { key: "budget_expected_income", value: @budget.estimated_income },
budget_form_spending_param: { key: "budget_budgeted_spending", value: @budget.estimated_spending }
budget_form_income_param: { key: "budget_expected_income", value: sprintf("%.2f", @budget.estimated_income) },
budget_form_spending_param: { key: "budget_budgeted_spending", value: sprintf("%.2f", @budget.estimated_spending) }
} %>
<label for="auto_fill" class="maybe-switch"></label>
</div>