Using latest version of Aspose Cells for Java.
The documentation at https://docs.aspose.com/display/cellsjava/Setting+Display+Formats+of+Numbers+and+Dates seems to suggest that using built-in number format 39 will display negative numbers using a minus sign, and without parentheses.
However, when I open the resulting Excel file, the value is shown as “(1,234,567.89)”.
The result is what I actually want
But just to double-check, could it be that the sample value for built-in number format 39 is incorrect in the linked article?
Workbook workbook = new Workbook(); Worksheet worksheet = workbook.getWorksheets().get(0); Cells cells = worksheet.getCells(); Cell cell = cells.get(0, 0); cell.setValue(-1234567.89); Style style = cell.getStyle(); style.setNumber(39); cell.setStyle(style); worksheet.autoFitColumns(); workbook.save("format.xlsx");
format.zip (6.3 KB)