Fix some of the missing docs for String.

This commit is contained in:
Relintai 2024-01-10 20:11:04 +01:00
parent 8e5ffcc9f1
commit bef218d7e4

View File

@ -1118,6 +1118,13 @@
<method name="to_double">
<return type="float" />
<description>
Converts a string containing a decimal number into a [code]double[/code]. The method will stop on the first non-number character except the first [code].[/code] (decimal point), and [code]e[/code] which is used for exponential.
[codeblock]
print("12.3".to_double()) # 12.3
print("1.2.3".to_double()) # 1.2
print("12ab3".to_double()) # 12
print("1e3".to_double()) # 1000
[/codeblock]
</description>
</method>
<method name="to_float">
@ -1149,6 +1156,18 @@
Returns the string converted to lowercase.
</description>
</method>
<method name="to_real">
<return type="float" />
<description>
Converts a string containing a decimal number into a [code]real[/code]. Reals can be either floats or doubles based on how the engine was compiled. By default they are floats. The method will stop on the first non-number character except the first [code].[/code] (decimal point), and [code]e[/code] which is used for exponential.
[codeblock]
print("12.3".to_real()) # 12.3
print("1.2.3".to_real()) # 1.2
print("12ab3".to_real()) # 12
print("1e3".to_real()) # 1000
[/codeblock]
</description>
</method>
<method name="to_uint">
<return type="int" />
<description>