The personal finance app for everyone
Fix precision in money input
Zach Gollwitzer31ecd3ccd4e1
diff --git a/app/views/shared/_money_field.html.erb b/app/views/shared/_money_field.html.erbindex e0922e02..0bbbc0a7 100644--- a/app/views/shared/_money_field.html.erb+++ b/app/views/shared/_money_field.html.erb@@ -26,7 +26,8 @@value: if options[:value]sprintf("%.#{currency.default_precision}f", options[:value])elsif form.object && form.object.respond_to?(amount_method)- form.object.public_send(amount_method)+ val = form.object.public_send(amount_method)+ sprintf("%.#{currency.default_precision}f", val) if val.present?end,min: options[:min] || -99999999999999,max: options[:max] || 99999999999999,