跳到主要内容

NUMBERVALUE

Converts text to a number, in a locale-independent way.

Syntax

expression.NUMBERVALUE(arg1, arg2, arg3);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | stringThe string representing a number to convert.
arg2OptionalApiRange | ApiName | stringThe character used as the decimal separator in the string.
arg3OptionalApiRange | ApiName | stringThe character used as the group separator in the string.

Returns

number

Example

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.NUMBERVALUE("2.500,27", ",", "."));