#590 Measures: an official library of formats by type (#585)
–
- github
- github/openchronology/timeline-app
- github/openchronology/timeline-app#590
- pull request
- state:merged
Closes #585, a follow-up to #570. Measures are now written and read by an **official library of formats**, the counterpart of the time displays such as Gregorian dates. Each format serves one type, and plugins never provide formats. | Type | Formats | | --- | --- | | `mpq` | Improper fraction (`7/2`, the default), floating point (significant digits), scientific notation, engineering notation (exponents in multiples of three: `123.456e3`) | | `mpz` | Fixed decimal values, such as currency: `$1,234.56` for 123456 cents. The default has 0 places. | - **Shared options:** every format keeps its scale (shown = stored × scale), prefix and unit. - **Exact both ways:** formats print and parse exactly, and refuse what they'd have to round (`$12.345` at 2 places). - **Tied to type:** a declaration whose format doesn't serve its type is refused. `MEASURE_FORMATS` lists the library. - **Replaced:** the modes `exact` and `si`, and the type-free `fixed` and `decimal`, give way to this set. None was released, so nothing stored needs migrating. - **Dialog:** the Measures dialog offers each type's formats, switching with the type. **Tests:** - unit tests of every format, both ways, and of the type rules; - the browser check, which confirms the formats offered for each type. I ran it in the Playwright image. Docs and OpenAPI are updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/circagraph/timeline-app/pull/590
Related
Open #590 Measures: an official library of formats by type (#585) in the timeline