(value: number)
| 18 | * Both cases are guarded by only trimming when the mantissa contains a '.'. |
| 19 | */ |
| 20 | export function formatDouble(value: number): string { |
| 21 | const str = value.toPrecision(17); |
| 22 | const [mantissa, exponent] = str.split(/e/i); |
| 23 | const trimmed = mantissa.includes('.') ? mantissa.replace(/\.?0+$/, '') : mantissa; |
| 24 | return exponent !== undefined ? `${trimmed}e${exponent}` : trimmed; |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * Sort map keys numerically. COLMAP sorts entries by ID before writing. |
no outgoing calls
no test coverage detected