Skip to content

Add percentage() and ratio() functions - #542

Closed
alexkm13 wants to merge 1 commit into
python-humanize:mainfrom
alexkm13:add-percentage-ratio-functions
Closed

alexkm13 wants to merge 1 commit into
python-humanize:mainfrom
alexkm13:add-percentage-ratio-functions

Conversation

@alexkm13

@alexkm13 alexkm13 commented Dec 2, 2026

Copy link
Copy Markdown
  • percentage(value, ndigits=None): converts a decimal to a percentage string
  • ratio(numerator, denominator, ndigits=2): formats two numbers as a fraction

Both use intcomma for large numbers and handle edge cases (None, NaN, Inf).

Closes #277

@agentscanapp

agentscanapp Bot commented Dec 2, 2026

Copy link
Copy Markdown

Insufficient data

Not enough activity yet to make a reliable assessment.

View full analysis →

This is an automated analysis by AgentScan

@alexkm13

alexkm13 commented Dec 3, 2026

Copy link
Copy Markdown
Author

Closing in favor of #413 which already addresses this issue.

@alexkm13 alexkm13 closed this Dec 3, 2026
@alexkm13
alexkm13 deleted the add-percentage-ratio-functions branch December 3, 2026 00:24
@hugovk

hugovk commented Dec 3, 2026

Copy link
Copy Markdown
Member

But why did you open and close this two times before this third PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Percentages and ratios

2 participants