lundi 29 septembre 2014

Convert string to float with precision in ruby


Vote count:

0




I have a newbie question to ask, when I convert string to float how do I put a dot two houses before the end? This is a example of what I want to do.



"000001909".to_f = 19.09


But only get this:



"000001909".to_f = 1909.0


asked 33 secs ago







Convert string to float with precision in ruby

Aucun commentaire:

Enregistrer un commentaire