1. Try out the .to_f operation. What does .to_f do?
.to_f converts string into float data type.
2. To play with .to_f more, make a small script that asks for some money and gives back 10% of it. If I give your script 103.4 (dollars), your script gives me back 10.34 in change.
Done. I used 20% and used 2 different ways to give the correct decimal places, however .round does not always return the desired point if the trailing numbers are zeros. I thought there were a way to convert to currency. So ‘%.2f’ % is still a better way to do it.