Does anybody know how to turn a floating-point number (i.e. 60.345) into an integer by cutting off or rounding the decimal portion? Either method, or both, would be quite welcome. Thanks! This forum rocks!
on 2006-04-06 11:29
on 2006-04-06 11:34
Yeah #to_i is what youre looking for. http://www.ruby-doc.org/docs/ProgrammingRuby/ -h
on 2006-04-06 11:53
Float.round will return the floor or ceil appropriately. -Linda