Skip to content

Commit

Permalink
* dtable: only format digits for number value in rich plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed Mar 11, 2024
1 parent 5590520 commit 0080d80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dtable/src/plugins/rich/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function renderLinkCell(result: CustomRenderResultList, info: {row: RowIn
export function renderFormatCell(result: CustomRenderResultList, info: {row: RowInfo, col: ColInfo, value: unknown}) {
const {format, digits} = info.col.setting;
let value = result[0];
if (typeof digits === 'number') {
if (typeof digits === 'number' && !Number.isNaN(Number(value))) {
value = Number(value);
if (digits >= 0) {
value = (value as number).toFixed(digits);
Expand Down

0 comments on commit 0080d80

Please sign in to comment.