跳到主要内容

Format

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

Syntax

expression.Format(expression, format);

expression - A variable that represents a Api class.

Parameters

NameRequired/OptionalData typeDefaultDescription
expressionRequiredstringAny valid expression.
formatOptionalstringA valid named or user-defined format expression.

Returns

string

Example

This example shows how to get a class formatted according to the instructions contained in the format expression.

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