typst-oxifmt
typst-oxifmt copied to clipboard
Convenient Rust-like string formatting in Typst (previously "typst-strfmt")
I realise that this is supposed to be a port of rust's `format!`, which does not support grouping digits (as in `1,000,000.0000`), but I maybe this feature is commonly wanted...
Typst 0.12 will bring fixed-point decimals, they should be supported by oxifmt and behave exactly like floats.
[C/C++](https://cplusplus.com/reference/cstdio/printf/), [Python](https://docs.python.org/2/library/string.html#format-specification-mini-language), and [Java](https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax) all support the `%g` formatting specifier, which effectively selects between `%e` and `%f` as appropriate. I was surprised to learn that Rust does not. If this...