Custom Format Number incorrect

Hi team!

I have Sheet1 and Sheet2.

In Sheet1:
Cell F3 has the following format:

  • Custom Number Format: #,##0_);[Red](#,##0)
  • Color: Green

Step 1: I enter a positive number, and cell F3 displays: 5 in Green.
Step 2: I enter a negative number, and cell F3 displays: (5) in Red.
Step 3: Switch to Sheet2 and return to Sheet1.
Step 4: Enter a positive number, and cell F3 displays in Red.

Shouldn’t it be Green?


Image_7619_1737443212965


Attachment: Screencast_from_21012025_14:03:22_2f2254a1.zip

4 Replies 1 reply marked as answer

JS Janakiraman Sakthivel Syncfusion Team January 23, 2025 11:35 AM UTC

Hi Ngoc Hoang,

We have confirmed the issue as "Cell formatting updated incorrectly with custom number format" and logged a bug report and it will be available in our February 5th patch release. We appreciate your patience in the meantime. You can track the status of the issue via the feedback link below.

Feedback link for tracking purpose:
https://www.syncfusion.com/feedback/64873/cell-formatting-updated-incorrectly-with-custom-number-format

Disclaimer:
"Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works re prioritization".



BP Babu Periyasamy Syncfusion Team February 13, 2025 08:50 AM UTC

Hi Ngoc Hoang,


We are glad to announce that our weekly patch release (28.2.5) is rolled out. And we have included the fix for the reported "Cell formatting updated incorrectly with custom number format" issue in this release. So, kindly upgrade your package version to the latest to avail of these changes (28.2.5).


Package link: https://www.npmjs.com/package/@syncfusion/ej2-react-spreadsheet/v/28.2.5


Feedback link: https://www.syncfusion.com/feedback/64873/cell-formatting-updated-incorrectly-with-custom-number-format


For your convenience, we have prepared the sample referring to the fixed package version and attached below along with the output screenshot,


Sample link: https://stackblitz.com/edit/react-gd7vj2yb-gpwadgne?file=package.json,index.js


Output Screenshot:


Image_6449_1739436126690


Issue Root Cause:
During the sheet switch action, the negative font color (red) was unintentionally copied at the model level due to shallow copying of the cell.style object. This mutation affected the shared state, leading to incorrect font color updates when entering positive values. This issue has been resolved now by implementing deep copying of the cell.style object instead of a shallow copy, ensuring that font colors remain correct during sheet switch actions.


Please let us know if you need further assistance on this.


Regards,

Babu.


Marked as answer

NH Ngoc Hoang replied to Babu Periyasamy February 13, 2025 09:14 AM UTC

It is great! Thank you for your hard work.



BP Babu Periyasamy Syncfusion Team February 19, 2025 04:42 AM UTC

Hi Ngoc Hoang,

Thank you for your update. Please get back to us for further assistance in the future.


Regards,

Babu.


Loader.
Up arrow icon