Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lentschi committed Jul 12, 2024
1 parent b078cfa commit a326faa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/helpers/articles_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def format_unit_factors(factors)

factor_str_arr
.compact
.join("#{Prawn::Text::NBSP}x#{Prawn::Text::NBSP}")
.join("#{Prawn::Text::NBSP}×#{Prawn::Text::NBSP}")
end

def format_unit_factor(factor, with_unit)
Expand All @@ -126,7 +126,7 @@ def format_unit_factor(factor, with_unit)
unit_label = is_si_conversible ? unit_data[:symbol] : unit_data[:name]
return unit_label if factor[:quantity] == 1

multiplier_str = 'x' unless is_si_conversible
multiplier_str = '×' unless is_si_conversible

[quantity_str, multiplier_str, unit_label]
.compact
Expand Down
4 changes: 2 additions & 2 deletions spec/helpers/articles_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_with_article_data(supplier_order_unit: nil, group_order_unit: nil, rati
ratios: [[20.148, 'KGM'], [20, 'XBO'], [10, 'LTR']],
group_order_unit: 'XBO'
)
expect(result).to eq('Crate (20 x 0.5 l)')
expect(result).to eq('Crate (20 × 0.5 l)')
end

it 'formats ratio from group order unit to first SI ratio if group order unit equals or defaults to supplier order unit' do
Expand All @@ -58,7 +58,7 @@ def test_with_article_data(supplier_order_unit: nil, group_order_unit: nil, rati
ratios: [[100, 'XPC'], [400, 'XPK'], [4000, 'X6H'], [200_000, 'GRM']],
group_order_unit: 'XPK'
)
expect(result).to eq('Pallet (400 x 500 g)')
expect(result).to eq('Pallet (400 × 500 g)')
end

it 'formats ratio from group order unit to first SI ratio' do
Expand Down

0 comments on commit a326faa

Please sign in to comment.