Skip to content

Commit 4b7f45f

Browse files
committed
Let's just present "-" if we don't know the value
1 parent ddc6608 commit 4b7f45f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/components/Datagrid/customCells/Money/MoneyDiscountedCell.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ export const moneyDiscountedCellRenderer = (): CustomRenderer<MoneyDiscuntedCell
2121
const { ctx, theme, rect } = args;
2222
const { currency, value, undiscounted, locale } = cell.data;
2323
const hasValue = value === 0 ? true : !!value;
24-
const formattedValue = getFormattedMoney(value ?? "", currency, locale, "-");
24+
// When the value is unknown we leave the price area blank; `drawCurrency`
25+
// below already renders a single "-" in the currency column, so emitting
26+
// another "-" here would produce a duplicate indicator.
27+
const formattedValue = hasValue ? getFormattedMoney(value ?? "", currency, locale) : "";
2528
const formattedUndiscounted = getFormattedMoney(
2629
undiscounted !== value ? (undiscounted ?? "") : "",
2730
currency,

0 commit comments

Comments
 (0)