core :: Text :: to_f
self
assert "123".to_f == 123.0 assert "-1".to_f == -1.0 assert "-1.2e-3".to_f == -0.0012
# If `self` contains a float, return the corresponding float # # ~~~ # assert "123".to_f == 123.0 # assert "-1".to_f == -1.0 # assert "-1.2e-3".to_f == -0.0012 # ~~~ fun to_f: Float do # Shortcut return to_s.to_cstring.atof end