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

Property definitions

core $ Text :: to_f
	# 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
lib/core/text/abstract_text.nit:262,2--273,4