TEXT

function TEXT(arg1: number | string = null, arg2: string = null): string

Description

Converts a value to text in a specific number format.

Parameters

arg1number | stringdefault: null

A number, a formula that evaluates to a numeric value, or a reference to a cell containing a numeric value.

arg2stringdefault: null

A number format in the text form from the Number format combo box on the Home tab.

Returns

string

Try It

var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue(oFunction.TEXT(45.5, "$0.00"));

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).