Skip to content

armgit / maybe

Public Imported from GitHub
0

The personal finance app for everyone

Allow 2 decimals when adding a balance (#614)

Pieter Beulquefc631e698d13
diff --git a/app/helpers/application_form_builder.rb b/app/helpers/application_form_builder.rb
index 16d3ffba..b84f6d0a 100644
--- a/app/helpers/application_form_builder.rb
+++ b/app/helpers/application_form_builder.rb
@@ -36,7 +36,8 @@ class ApplicationFormBuilder < ActionView::Helpers::FormBuilder
default_options = {
class: "form-field__input",
value: money&.amount,
- placeholder: Money.new(0, money&.currency || Money.default_currency).format
+ placeholder: Money.new(0, money&.currency || Money.default_currency).format,
+ step: "0.01" # Not all currencies have 2 decimal places
}
merged_options = default_options.merge(options)