TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

GetNumberFormat

GetNumberFormat() → { string | null }

Returns a value that represents the format code for the current range.

Parameters:

This method doesn't have any parameters.

Returns:

Type
string | null

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oRange = oWorksheet.GetRange("B2");
oRange.SetValue(3);
var sFormat = oRange.GetNumberFormat();
oWorksheet.GetRange("B3").SetValue("Number format: " + sFormat);
builder.SaveFile("xlsx", "GetNumberFormat.xlsx");
builder.CloseFile();

Resulting document