string.float

This function converts the string to a float.

Syntax

string.float(str1, precision)

Arguments

Argument

Type

Description

str1

string

Source string

precision

number

(Optional) The default is 16.

Returns

Type

Description

float64

The float value of str1

Examples

The function string.float("2.77876542316664548335",14) returns 2.77876542316665.