From: James Deuchar Date: 2006-08-30T01:00:48+09:00 Subject: Testing a string's value is a positive integer Hi, I'm trying to find an nice way of verifying that the value of a String object (from the RoR params) contains a positive integer value. Casting my string to_i and then testing that it is_a(Numeric) and is > 0 doesn't do the trick because the to_i method converts something like '1.1' to a Fixnum of value 1 which would then pass the test when it shouldn't... I feel certain I must be missing a trick here...am about to go down the path of regexp which feels...wrong? Any advice for a newcomer would be gratefully received! Thanks James -- Posted via http://www.ruby-forum.com/.