The issue is that you are using
to_f on a string having invalid format for a float. The ruby
to_f only take the digits before
, and returns the float. You should not be worried about converting the string into float.
The correct code will be:
@price_column = sheet.column(15) @price_column.each do |c| c.to_s.gsub!(/\./,",") end