(value: string)
| 212 | } |
| 213 | |
| 214 | function parseFiniteNumber(value: string): number | null { |
| 215 | // Used for the `measuredNumeric` display field: lenient leading-numeric |
| 216 | // strip, separate from the end-anchored unit-aware comparison. |
| 217 | const match = /^[-+]?\d+(?:\.\d+)?/.exec(value.trim()); |
| 218 | if (!match) return null; |
| 219 | const parsed = Number.parseFloat(match[0]); |
| 220 | return Number.isFinite(parsed) ? parsed : null; |
| 221 | } |
| 222 | |
| 223 | function formatFraction(value: number): string { |
| 224 | return `${(value * 100).toFixed(1)}%`; |
no outgoing calls
no test coverage detected