My first thought was:
excelAppRange.map! {|n| n.to_f*100}
which leaves excelAppRange as an array of results
My next thought was that you might need numerical strings for some reason:
excelAppRange.map! {|n| (n.to_f*100).to_s}
Finally, you might not want to change excelAppRange, so you would want:
new_mapped_array = excelAppRange.map {|n| (n.to_f*100).to_s}
Hope this helps,
/\/\ark
Hi All,
excelAppRange.length.times do |y|
excelValString = excelVal.to_s
end
Thanks in advance.
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 3089 (20080509) __________
The message was checked by ESET NOD32 Antivirus.
__________ Information from ESET NOD32 Antivirus, version of virus signature
database 3089 (20080509) __________
The message was checked by ESET NOD32 Antivirus.
This means you don't need to convert to floats, but you do need to unwrap
another level of array. I'm still not sure how you want your output, as an
array of arrays:
excelAppRange.map! {|n| [n[0]*100]}
or as an array of strings:
excelAppRange.map! {|n| (n[0]*100).to_s}
If this doesn't work for you, please show us the actual data structures you
are converting from and the actual resultant data structure you expect.
excelAppRange = @worksheet.Range("b5:b8").Value
excelAppRange.map! {|n| n[0]*100}
abs =$ie.cell(:id,cellId[x].to_s).text.delete('%')
I'm not sure if it will pass your assert or not, but perhaps it will get you
close enough.
assert_equal(excelAppRange[y])to_s),sprintf("%.2f",abs).to_s)
/\/\ark