More powerful number formatting
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 554
- Forks
- 30
- Avg merge
- 17h 27m
- Merged PRs (30d)
- 8
Description
We currently rely on the sprintf crate for printf like formatting in the {:num ...} formatter. While it handles a lot it does not handle everything (e.g. thousand separator etc). While this is fine for now with only break values needing this, we may need stronger support when table support lands:
Two options:
- numfmt: Arguably the largest feature addition, but using a formatting spec that is somewhat foreign to most.
- format_num: Adds comma-only thousand separator with familiar (but slightly different - based on D3) printf syntax (minus % prefix). Also adds SI-unit and a bunch of other features (but fewer than numfmt)
Both are negligible in terms of binary size/compile time so a real option is to have both options available. Very little is lost by switching to format_num for the {:num ...} formatter and we could have auto detection of the format string to conditionally pass it to numfmt or format_num
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the current {:num ...} formatter and its use of the sprintf crate. Compare the proposed numfmt and format_num approaches, including auto-detection and future table support, then define the supported formatting behavior and tests before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100