From 185017b922073b7607a06fe8ee4915d4b71d7720 Mon Sep 17 00:00:00 2001 From: Danilo Costa Viana Date: Fri, 13 Dec 2019 11:34:26 -0300 Subject: [PATCH] Clarifying how float(String from) parses partially invalid strings Update the description of this method to be in line with [code]int int(String from)[/code] in regards to how it deals with a completely invalid parameter and a partially invalid parameter. --- doc/classes/float.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/classes/float.xml b/doc/classes/float.xml index 4c4ea831574..7164e8cb0a5 100644 --- a/doc/classes/float.xml +++ b/doc/classes/float.xml @@ -33,7 +33,7 @@ - Cast a [String] value to a floating-point value. This method accepts float value strings like [code]"1.23"[/code] and exponential notation strings for its parameter so calling [code]float("1e3")[/code] will return 1000.0 and calling [code]float("1e-3")[/code] will return 0.001. + Cast a [String] value to a floating-point value. This method accepts float value strings like [code]"1.23"[/code] and exponential notation strings for its parameter so calling [code]float("1e3")[/code] will return 1000.0 and calling [code]float("1e-3")[/code] will return 0.001. Calling this method with an invalid float string will return 0. This method stops parsing at the first invalid character and will return the parsed result so far, so calling [code]float("1a3")[/code] will return 1 while calling [code]float("1e3a2")[/code] will return 1000.0.