python-humanize / python-humanize/humanize
Percentages and ratios
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 756
- Forks
- 148
- Avg merge
- 6d 1h
- Merged PRs (30d)
- 12
Description
Hello, thanks a lot for this great package !
If I'm not mistaken there is no feature yet to humanize a ratio (between 0 and 1) or a percentage (between 0-100).
It could be a great addition ! It can be just one function to handle both, with two possible inputs (ratio= or percent=). The outcome would in both cases, be a truncated percent string with optional decimal coma up to a given precision, as in 12,5%. Customization of precision with a number of decimal could be similar to precisedelta's precision customization with the units.
Contributor guide
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 comparing the proposed ratio and percent API with precisedelta's precision customization. Verify ratio and percent inputs, truncation, optional decimal precision, and the requested percent-string formatting; completion should include coverage in the project's existing tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100