(value?: string | null)
| 36 | } |
| 37 | |
| 38 | export function formatTimestamp(value?: string | null) { |
| 39 | if (!value) return ''; |
| 40 | const date = new Date(value); |
| 41 | if (Number.isNaN(date.getTime())) return ''; |
| 42 | return new Intl.DateTimeFormat('zh-CN', { |
| 43 | month: 'short', |
| 44 | day: 'numeric', |
| 45 | hour: '2-digit', |
| 46 | minute: '2-digit', |
| 47 | }).format(date); |
| 48 | } |
| 49 | |
| 50 | export function formatCurrency(value?: number | null) { |
| 51 | return value ? `US$${value.toFixed(4)}` : 'US$0.0000'; |
no outgoing calls
no test coverage detected