views:

81

answers:

1

Very beginner's question: I noticed that there's no .to_d (such as order.price.to_d to convert order.price into a decimal). Say order.price is currently a string; can I then use order.price.to_i to convert it into a decimal?

+6  A: 

The Ruby corelib documentation is your friend!

>> "9.95".to_f
=> 9.95
>> "9.95".to_f.class
=> Float
>>
Edwin V.
Awesome! Thank you Edwin!!
Drew