summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-12-13 15:47:18 +0100
committerGitHub <noreply@github.com>2019-12-13 15:47:18 +0100
commit37f664b1a524226a4292a6bd2e613a740f634de2 (patch)
tree94aab3b9f25521e5fcbce2868a0abd58bc35f50f
parentcf3a863fa92253ecb833a66cc2acb1463e6002d1 (diff)
parent185017b922073b7607a06fe8ee4915d4b71d7720 (diff)
Merge pull request #34328 from Dancovich/patch-1
Clarifying how float(String from) parses partially invalid strings
-rw-r--r--doc/classes/float.xml2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/classes/float.xml b/doc/classes/float.xml
index 4c4ea83157..7164e8cb0a 100644
--- a/doc/classes/float.xml
+++ b/doc/classes/float.xml
@@ -33,7 +33,7 @@
<argument index="0" name="from" type="String">
</argument>
<description>
- 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.
</description>
</method>
</methods>