PgBiel / typst-oxifmt

Convenient Rust-like string formatting in Typst (previously "typst-strfmt")
Apache License 2.0
32 stars 0 forks source link

Feature request: digit grouping (thousands separator) #5

Closed Jollywatt closed 1 month ago

Jollywatt commented 10 months ago

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 in typesetting and can be justified.

(Example use case: At the moment, I'm having to load and combine both oxifmt and metro to format numbers with 1) thousands separators 2) an exact number of decimal digits. If this was added to oxifmt, then it alone would be sufficient!)

PgBiel commented 10 months ago

Sure, we can do it. Not sure which syntax I would use though, at least without conflicting with the Rust syntax...

Perhaps we could add a second : for custom stuff. Or something.