We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How the format of the cell

Hi
i have a excel template and i formatted one of the cell as number .In code how to get the format of the cell
worksheet.Cells[0, 0] i need get the format assosiated with the cell

Hi,

Thanks for your posting and using Aspose.Cells.

Please download and use the latest version:
Aspose.Cells
for .NET v7.1.2.3



For your needs, you can access all the style/format related information of cell from Style object.

e.g

C#


Style st = cell.GetStyle();


//Now access the format associated with cell from style object properties.

how to get format using Style st = cell.GetStyle();
like General,Date,Number,percentage that is i need to check my cell is Number formated or General formated or adte format

Hi,

Please see these properties to find the number/date formats.

  1. style.Number
  2. style.CultureCustom
  3. style.Custom

If the number/date format is built-in, you will find it in style.Number.

If the number/date format is custom, you will find in CultureCustom or Custom properties.

Please also see this document for your more help.
Setting Display Formats of Numbers and Dates