From: Peter Bailey Date: 2008-01-08T03:06:00+09:00 Subject: Where do I put the ".to_f" ? Hello, I need to do some simply computations on numbers pulled from a file. I get the numbers using "scan." I've proven that I can get the numbers alright. But, I need to do some division and multiplication on those numbers, and, to be accurate, the numbers need to be floating numbers, not integers. So, I've tried everything, or so I think, and Ruby keeps complaining about my ".to_f" method. Can someone please tell me where this .to_f should go? Thanks, Peter Dir.chdir("K:") tifffile = File.basename(ARGV.to_s, ".*") + ".tif" info = `tiffinfo #{tifffile}` width = info.scan(/Image Width: ([0-9]{1,5})/) depth = info.scan(/Image Length: ([0-9]{1,5})/) res = info.scan(/Resolution: [0-9]{1,5}, ([0-9]{1,5}) pixels\/inch/) newwidth = width.to_f / 600 * 6 newdepth = depth.to_f / 600 * 6 I get this from Ruby: sizer.rb:10: undefined method `to_f' for [["5100"]]:Array (NoMethodError) -- Posted via http://www.ruby-forum.com/.