This is my line of code:
col_value = line_item[column].scan(/\d+./).join().to_i
When I enter 30,000 into the textfield, col_value is 30. I want it to bring in any number: 30,000 30.5 30.55 30000
Any of these are valid...
Is there a problem with the scan and or join which would cause it to return 30? Using the suggested regexes below still retunrs 30 e.g.
col_value = line_item[column].scan(/\d+[,.]?\d+/).join().to_i
Could it be that "
to_i" converts "30,000" to 30??