| 123456789101112131415161718 |
- const ringgit = new Intl.NumberFormat('en-MY', {
- style: 'currency',
- currency: 'MYR',
- });
-
- const dateTime = new Intl.DateTimeFormat('en-MY', {
- dateStyle: 'medium',
- timeStyle: 'short',
- });
-
- /** 12.9 becomes "RM 12.90". */
- export function formatRinggit(amount: number): string {
- return ringgit.format(amount);
- }
-
- export function formatDateTime(iso: string | null): string {
- return iso ? dateTime.format(new Date(iso)) : '';
- }
|