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

Free Support Forum - aspose.com

Number of displayed decimal places

Is it possible to have 4 decimal places displayed in the cell?

It allows for 4 decimal places when I use numberformat 11 or have a custom of "0.0000" but it only displays 2 decimal places and I'd like to display 4.


Well, Style.NumberFormat 11 is a scientific notation, check: http://www.aspose.com/documentation/visual-components/aspose.grid-for-.net/aspose.grid.desktop.style.numberformat.html and when I specify Style.Custom to set to "0.0000" string, it works just fine as it displays 4 decimal places. I am still not very clear where your issue lies, could you elaborate so that we may check. Anyways following is my testing code and it works fine, I use Aspose.Grid.Desktop version

Sample code:

In the Form_Load Event I put the following test code:

Dim sheet As Aspose.Grid.Desktop.Worksheet = GridDesktop1.Worksheets(0)

Dim cell As Aspose.Grid.Desktop.GridCell = sheet.Cells("c4")
cell.Value = 34.89735
Dim style As Aspose.Grid.Desktop.Style = cell.GetStyle()
style.Custom = "0.0000"

Thank you.