Percentages and ratios

Open
#277 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

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.

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.

Dominant language
Python
Stars
757
Forks
148
Avg merge
6d 1h
Merged PRs (30d)
12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-humanize/humanize

All issues in python-humanize/humanize

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.