Spaces:
Sleeping
Sleeping
| export function currency(value: number | string | undefined) { | |
| const numberValue = Number(value ?? 0); | |
| return new Intl.NumberFormat('en-IN', { | |
| style: 'currency', | |
| currency: 'INR', | |
| maximumFractionDigits: 2 | |
| }).format(numberValue); | |
| } | |
| export function dateTime(value: string | undefined) { | |
| if (!value) return '-'; | |
| return new Intl.DateTimeFormat('en-IN', { | |
| dateStyle: 'medium', | |
| timeStyle: 'short' | |
| }).format(new Date(value)); | |
| } | |