Get Started
Documentation

Format

Format(expression, [format]) → { string }

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

Parameters:

Name Type Default Description
expression string

Any valid expression.

format string null

A valid named or user-defined format expression.

Returns:

Type
string

Example

Copy code
builder.CreateFile("xlsx");
oWorksheet = Api.GetActiveSheet();
oFormat = Api.Format("123456", ["$#,##0"]);
oWorksheet.GetRange("A1").SetValue(oFormat);
builder.SaveFile("xlsx", "Format.xlsx");
builder.CloseFile();

Resulting document