From: Rob Biedenharn on
On Aug 11, 2010, at 11:28 AM, Fela Winkelmolen wrote:

>> Might give some strange behaviour though:
>>
>> "1$".to_f => 1.0
>> "nonsense".to_f => 0.0
>> "nanotubes".to_f => Nan ?
>> "inferiority".to_f => Inf ?
>
> well, it's not so much "stranger" than the following I suppose
>
> "24/7".to_f => 24.0
>


On 1.9, try:

irb> "24/7".to_r
=> (24/7)
irb> _.class
=> Rational

-Rob

Rob Biedenharn
Rob(a)AgileConsultingLLC.com http://AgileConsultingLLC.com/
rab(a)GaslightSoftware.com http://GaslightSoftware.com/