Skip to main content

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

This example shows how to convert text to a number, in a locale-independent way.

// How to get a number from text.

// Use a function to convert a text to a number.

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