float()

Description:

Convert a string or a number into a 64-bit double-precision floating-point number.

Syntax:

float(stringExp)

float(numberExp)

Note:

stringExp should be a string that consists of a number which has 64 bits or less than. For a value of more than 64 bits, the result of float(stringExp) is imprecise.

 

numberExp should be a numeric value which has 64 bits or less. For a value of more than 64 bits, the result of float(numberExp) is imprecise.

Parameter:

stringExp

The string expression you want to convert as a double-precision floating-point number

numberExp

The number you want to convert as a double-precision floating-point number

Return value:

A 64-bit double-precision floating-point number

Example:

float("1234567")

1234567.0

float(1234567)

1234567.0

Related function:

decimal()

int()

long()

number()

string()