Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(numfmt): numfmt skip null or undefined (#3188)

Gpound.liua923a9313011
diff --git a/packages/sheets-numfmt/src/controllers/numfmt.cell-content.controller.ts b/packages/sheets-numfmt/src/controllers/numfmt.cell-content.controller.ts
index 9138e9de88..9c2df780d6 100644
--- a/packages/sheets-numfmt/src/controllers/numfmt.cell-content.controller.ts
+++ b/packages/sheets-numfmt/src/controllers/numfmt.cell-content.controller.ts
@@ -81,7 +81,7 @@ export class SheetsNumfmtCellContentController extends Disposable {
}
// just handle number
- if (originCellValue.t !== CellValueType.NUMBER) {
+ if (originCellValue.t !== CellValueType.NUMBER || originCellValue.v == null || Number.isNaN(originCellValue.v)) {
return next(cell);
}