Format

function Format(expression: string = null, format: string = null): string

Description

Returns a class formatted according to the instructions contained in the format expression.

Parameters

expressionstringdefault: null

Any valid expression.

formatstringdefault: null

A valid named or user-defined format expression.

Returns

string

Try It

var oWorksheet = Api.GetActiveSheet();
var oFormat = Api.Format("123456", "$#,##0");
oWorksheet.GetRange("A1").SetValue(oFormat);

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).