1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-10 07:55:21 +02:00

fix do not round up when abbreviating

This commit is contained in:
Luan Estradioto 2025-04-15 12:03:50 -03:00
parent 5d8954b332
commit 63f4c77160

View file

@ -45,8 +45,8 @@ module Money::Formatting
value = abs_amount / 1000.0
end
# Always use period as decimal separator for abbreviations
abbrev_options = options.merge(precision: 1, separator: ".")
# Always use period as decimal separator for abbreviations and don't round up
abbrev_options = options.merge(precision: 1, separator: ".", round_mode: :down)
value_formatted = number_to_rounded(value, abbrev_options)
abbreviated_num = "#{value_formatted}#{unit_suffix}"