Percent formats


#1

I’m working with spreadsheets that contain percent columns (the columns vary between spreadsheets). The underlying values have lots of decimal places but are often set to display 1, 2 or more decimal places. I need maximum possible precision for calculations so I’m extracting the value using the DoubleValue property of the Cell object and multiplying by 100 if the Number property of the Style object is a 9 or a 10. The problem I have is that when percentage values are set to display 1 or 3 or more decimal places Aspose.Cells tells me that the cell is a number 0 (General format). I can’t include 0 in my list of cells to multiply 100 to because there are other numeric cells in the spreadsheet that will have General formatting.

Is there any other deterministic way of telling if a cell is a percent value?

Thanks,
Wayne


#2

If the percentage values are set to display 1 or 3 or more decimal places, Style.Number may be number 0. In this case, Style.Custom must return something. Please check it.