Home
Ruby
ActiveRecord
Array
CGI
Class
Collections
Database
Date
Design Patterns
Development
File Directory
GUI
Hash
Language Basics
Method
Network
Number
Rails
Range
Reflection
Statement
String
Threads
Time
Tk
Unit Test
Windows Platform
XML
Convert string to float : Convert to Float « Number « Ruby
Ruby
Number
Convert to Float
Convert string to float
'3.14'
.to_f # => 3.14
'1.602e-19'
.to_f # => 1.602e-19
Related examples in the same category
1.
create or convert floating-point numbers with Kernel's Float method
2.
the percentage
3.
try weird conversions