mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-05 02:41:33 +00:00
Refactor option_value_value_unit_scaled to use to_d instead of calling BigDecimal
As we are now using truncate(2) we don't need to specify the number of significant digits
This commit is contained in:
@@ -56,7 +56,7 @@ module VariantUnits
|
||||
def option_value_value_unit_scaled
|
||||
unit_scale, unit_name = scale_for_unit_value
|
||||
|
||||
value = BigDecimal(@variant.unit_value / unit_scale, 6).truncate(2)
|
||||
value = (@variant.unit_value / unit_scale).to_d.truncate(2)
|
||||
|
||||
[value, unit_name]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user