rez-table-listing-mui
Version:
A rez table listing component built on TanStack Table
19 lines (16 loc) • 438 B
text/typescript
import { formatAmount } from "./amount-format";
import { formatDate } from "./date-format";
export const DataFormat = (value: any, type: string) => {
if (!value) return "";
switch (type) {
case "date":
return formatDate({ date: value, style: "DD-MMM-YYYY" });
case "amount":
return formatAmount({
amount: value,
decimal: false,
});
default:
return value;
}
};