float

Category: Built-In Types

Brief Description

Float built-in type

Member Functions

float float ( bool from )
float float ( int from )
float float ( String from )

Description

Float built-in type.

Member Function Description

float float ( bool from )

Cast a bool value to a floating point value, float(true) will be equals to 1.0 and float(false) will be equals to 0.0.

float float ( int from )

Cast an int value to a floating point value, float(1) will be equals to 1.0.

float float ( String from )

Cast a String value to a floating point value. This method accepts float value strings like `` ‘1.23’ `` and exponential notation strings for its parameter so calling `` float(‘1e3’) `` will return 1000.0 and calling `` float(‘1e-3’) `` will return -0.001.

© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/2.1/classes/class_float.html