public static WriteCellData<?> formatToCellData(Number num, ExcelContentProperty contentProperty) {
        WriteCellData<?> cellData = new WriteCellData<>(new BigDecimal(num.toString()));
        if (contentProperty != null && contentProperty.getNumberFormatProperty() != null
            && StringUtils.isNotBlank(contentProperty.getNumberFormatProperty().getFormat())) {
            WorkBookUtil.fillDataFormat(cellData, contentProperty.getNumberFormatProperty().getFormat(), null);
        }
        return cellData;
    }
format

@param num
@param contentProperty
@return
fastexcel-core/src/main/java/cn/idev/excel/util/NumberUtils.java