(n: number | string | undefined | null)
| 61 | } |
| 62 | |
| 63 | function fmtNum(n: number | string | undefined | null): string { |
| 64 | if (n == null || n === '') return '' |
| 65 | if (isUnsetDecimal(n)) return '' |
| 66 | if (typeof n === 'string') return n |
| 67 | if (!Number.isFinite(n)) return String(n) |
| 68 | const rounded = n.toFixed(8).replace(/\.?0+$/, '') |
| 69 | const [intPart, decPart] = rounded.split('.') |
| 70 | const withCommas = Number(intPart).toLocaleString(getIntlLocale()) |
| 71 | return decPart ? `${withCommas}.${decPart}` : withCommas |
| 72 | } |
| 73 | |
| 74 | function orderTypeLabel(type: string | undefined): string { |
| 75 | const raw = (type || '').toUpperCase() |
no test coverage detected