godot/doc/classes/float.xml
Rémi Verschelde 2d20fc39aa doc: Drop unused 'category' property from header
We already removed it from the online docs with #35132.

Currently it can only be "Built-In Types" (Variant types) or "Core"
(everything else), which is of limited use.

We might also want to consider dropping it from `ClassDB` altogether
in Godot 4.0.
2020-01-26 16:02:39 +01:00

43 lines
1.6 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<class name="float" version="3.2">
<brief_description>
Float built-in type.
</brief_description>
<description>
Float built-in type.
</description>
<tutorials>
</tutorials>
<methods>
<method name="float">
<return type="float">
</return>
<argument index="0" name="from" type="bool">
</argument>
<description>
Cast a [bool] value to a floating-point value, [code]float(true)[/code] will be equal to 1.0 and [code]float(false)[/code] will be equal to 0.0.
</description>
</method>
<method name="float">
<return type="float">
</return>
<argument index="0" name="from" type="int">
</argument>
<description>
Cast an [int] value to a floating-point value, [code]float(1)[/code] will be equal to 1.0.
</description>
</method>
<method name="float">
<return type="float">
</return>
<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. 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>
<constants>
</constants>
</class>