TEXT
Converts a value to text in a specific number format.
Syntax
expression.TEXT(arg1, arg2);
expression
- A variable that represents a ApiWorksheetFunction class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
arg1 | Required | ApiRange | ApiName | number | string | A number, a formula that evaluates to a numeric value, or a reference to a cell containing a numeric value. | |
arg2 | Required | ApiRange | ApiName | string | A number format in the text form from the -Number format combo box on the -Home tab. |
Returns
string
Example
- Code
- Result
let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.TEXT(45.5, "$0.00"));