Changelog
Features:
- The new
quanfunction provides a new way of defining quantities and units. - Zero now adds alt descriptions for all numbers and units for supported languages. New translations are welcome.
Rounding:
⚠️ Breaking change: the rounding API was changed to a more comprehensible model and to better reflect common applications. Numbers with an uncertainty are by default (round.follow-uncertainty: true) rounded to the precision of the uncertainty − we call this automatic rounding. If no uncertainty is present orround.follow-uncertainty: false, manually rounding is applied according to the optionsmodeandprecision. Themode: "uncertainty"has been removed.⚠️ Breaking change: zeros are now trimmed after rounding and padding is independent. This leads to the following effect of change:- Before:
num(round: (precision: 2, pad: false)[0.299]-> 0.30 - Now:
num(round: (precision: 2, pad: false)[0.299]-> 0.3
- Before:
- Fixed a bug where rounding to zero were for negative precision led to multiple zeros being displayed in the integer part.
- Fixed rounding to negative (integer) places.
- Fixed rounding of 0 to a positive number of significant figures: now no trailing zeros are displayed anymore.
Input:
- Added support for capital E in exponent notation.
Formatting:
- New option
num.trim-zerosfor trimming trailing zeros. - New option
num.omit-zero-exponent. - Fixed: Automatic exponents with scientific or engineering notation are now omitted when the mantissa is 0 and no explicit exponent is given.
- Fixed prevention of line breaks and add more fine-grained line break control: after the ×, after the ± and before the unit.
⚠️ Breaking change: moved the parameterbreakablefromset-unittoset-numsince it now also affects numbers.- Fixed
num.use-sqrtwith inline fraction mode. - Fixed formatting of exponents with custom decimal separators.
- Fixed an error with scientific mode with asymmetric uncertainties.
- Fixed a tiny detail when formatting the decimal separator.
API:
- Added queryable metadata to numbers and units.
- Moved the internal
num-stateto the impl module.
I would like to thank @SeSodesa and @hpcfzl for large contributions towards the accessibility feature, @Ants-Aare for implementing the metadata and adding two new units, and @DegrangeM, @LordBaryhoba, @FilouPlains, and @Netzwerk2 for reporting important issues before they were released.
Happy solar eclipse!