diff --git a/app/services/variant_units/option_value_namer.rb b/app/services/variant_units/option_value_namer.rb index fa6cbd4c158..40ca0a23609 100644 --- a/app/services/variant_units/option_value_namer.rb +++ b/app/services/variant_units/option_value_namer.rb @@ -58,7 +58,7 @@ def option_value_value_unit def option_value_value_unit_scaled unit_scale, unit_name = scale_for_unit_value - value = (@nameable.unit_value / unit_scale).to_d.round(2) + value = (@nameable.unit_value.to_d / unit_scale).round(2) [value, unit_name] end diff --git a/spec/lib/reports/sales_tax_totals_by_order_spec.rb b/spec/lib/reports/sales_tax_totals_by_order_spec.rb index 0e6be04375b..603331788a5 100644 --- a/spec/lib/reports/sales_tax_totals_by_order_spec.rb +++ b/spec/lib/reports/sales_tax_totals_by_order_spec.rb @@ -145,7 +145,8 @@ total = report.total_excl_tax(query_row) # discounted order total - discounted order tax - expect(total).to eq((BigDecimal('113.3') - 10) - (BigDecimal('3.3') - BigDecimal('0.29'))) + # (113.3 - 10) - (3.3 - 0.29) + expect(total).to eq 100.29 end end end