Force significant: false for NumberHelper

Although it defaults to false, somehow it seems to be evaluated as true on hu_prod...??!?!!1! (https://github.com/openfoodfoundation/openfoodnetwork/issues/12682)
Maybe this will help.
This commit is contained in:
David Cook
2024-07-18 11:06:42 +10:00
parent a66fec0b26
commit bba59c1ffd

View File

@@ -25,7 +25,7 @@ class WeightsAndMeasures
available_units_sorted.flat_map do |measurement, measurement_info|
measurement_info.filter_map do |scale, unit_info|
scale_clean =
ActiveSupport::NumberHelper.number_to_rounded(scale, precision: nil,
ActiveSupport::NumberHelper.number_to_rounded(scale, precision: nil, significant: false,
strip_insignificant_zeros: true)
[
"#{I18n.t(measurement)} (#{unit_info['name']})", # Label (eg "Weight (g)")