From: "Jan E." Date: 2012-06-27T05:20:18+09:00 Subject: Re: Match part of the calculated value Hi, ideal one wrote in post #1066196: > Gross1 =~ /#{Gross2}/ > This throws as nil for me, even if first 3 values are matching, i should > consider it was true match... Using the =~ operator on an Integer makes no sense, because the operator isn't really defined for Integers. It uses the dummy definition of Object#=~, which simply returns nil and does nothing else. But even if you convert the Integer to a String, it will get you nowhere, because that's just not how regular expressions work. You'll probably have to convert Gross1 to a String and go through each digit (each_char), checking if Gross2 has the same digit (the decimal point has to be skipped). However, I'm not even sure how you want to compare the values: gross1 = 414.23 gross2 = 542.14 How many matches do we have? 2? 3? Or more? Please note: Don't use capitalized names. Ruby interprets them as constants (which is probably not what you want). -- Posted via http://www.ruby-forum.com/.