add to_s.gsub4

This commit is contained in:
viehlieb 2023-02-20 23:49:59 +01:00
parent 971b9d7031
commit 573851e549

View file

@ -76,7 +76,7 @@ module FoodsoftArticleImport
unless row[37].nil? && row[65].nil? && row[66].nil? unless row[37].nil? && row[65].nil? && row[66].nil?
scale_factor = row[66].gsub(',', '.').to_f scale_factor = row[66].gsub(',', '.').to_f
price = row[37].gsub(',', '.').to_f price = row[37].gsub(',', '.').to_f
price_per = (scale_factor * price).to_s.gsub('.', ',') price_per = (scale_factor * price).round(2).to_s.gsub('.', ',')
article.merge!(:price_per => price_per) article.merge!(:price_per => price_per)
article.merge!(:unit_symbol => row[65] ) article.merge!(:unit_symbol => row[65] )
end end