remove $ on table and remove decimal on max transaction per day in transfer type module

This commit is contained in:
bagusajisaputroo
2025-05-18 11:37:53 +07:00
parent c1afae4bff
commit b8cadc03c0
3 changed files with 17 additions and 3 deletions

View File

@ -378,6 +378,10 @@ const AddDialog = () => {
thousandSeparator="."
decimalSeparator=","
allowNegative={false}
decimalScale={0}
isAllowed={({ floatValue }) =>
floatValue === undefined || Number.isInteger(floatValue)
}
onValueChange={(values) => {
setFormField((prev) => ({
...prev,

View File

@ -574,6 +574,10 @@ const EditDialog = () => {
thousandSeparator="."
decimalSeparator=","
allowNegative={false}
decimalScale={0}
isAllowed={({ floatValue }) =>
floatValue === undefined || Number.isInteger(floatValue)
}
onValueChange={(values) => {
setFormField((prev) => ({
...prev,

View File

@ -24,13 +24,19 @@ function useDebounce<T>(value: T, delay: number): T {
const formatNumber = (num: number): string => {
return num.toLocaleString('en-US', {
style: 'currency',
currency: 'USD',
style: 'decimal',
minimumFractionDigits: 2,
maximumFractionDigits: 2
});
};
const formatInteger = (num: number): string => {
return num.toLocaleString('en-US', {
style: 'decimal',
maximumFractionDigits: 0
})
}
interface AccountProps {
id: string;
name: string;
@ -195,7 +201,7 @@ const ManageTransferTypeContextProvider = ({ children }: { children: React.React
header: ({ column }) => (
<DataGridColumnHeader title="Max Transaction Per Day" column={column} />
),
cell: ({ row }) => formatNumber(row.original.max_transaction_per_day),
cell: ({ row }) => formatInteger(row.original.max_transaction_per_day),
enableSorting: false,
enableHiding: false,
meta: { headerClassName: 'w-[250px]' }