float

Syntax

  • float float(value)

Parameters

  1. value(float, bool, string)Value to convert.

Returns

Float value calculated from value.

Description

The float function converts value to the corresponding float value.

Examples

float("0.5")
# result = 0.5
float(true)
# result = 1
float("001.5")
# result = 1.5
float(1/0)
# result = inf

Was this article helpful?