1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00

Fix precision in money input

This commit is contained in:
Zach Gollwitzer 2024-11-11 09:39:32 -05:00
parent 3ef67faf7e
commit 31ecd3ccd4

View file

@ -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,