How to use the humanize.apnumber function in humanize

To help you get started, we’ve selected a few humanize examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jmoiron / humanize / tests / test_number.py View on Github external
def test_apnumber(test_input, expected):
    assert humanize.apnumber(test_input) == expected
github gil9red / SimplePyScripts / humanize__examples / integer__humanization.py View on Github external
# pip install humanize
import humanize


# Integer humanization:
print(humanize.intcomma(12345))      # '12,345'
print(humanize.intcomma(123456789))  # '123,456,789'
print()

print(humanize.intword(123455913))      # '123.5 million'
print(humanize.intword(12345591313))    # '12.3 billion'
print(humanize.intword(1339014900000))  # '1.3 trillion'
print()

print(humanize.apnumber(4))   # 'four'
print(humanize.apnumber(7))   # 'seven'
print(humanize.apnumber(41))  # '41'
github gil9red / SimplePyScripts / humanize__examples / integer__humanization.py View on Github external
# pip install humanize
import humanize


# Integer humanization:
print(humanize.intcomma(12345))      # '12,345'
print(humanize.intcomma(123456789))  # '123,456,789'
print()

print(humanize.intword(123455913))      # '123.5 million'
print(humanize.intword(12345591313))    # '12.3 billion'
print(humanize.intword(1339014900000))  # '1.3 trillion'
print()

print(humanize.apnumber(4))   # 'four'
print(humanize.apnumber(7))   # 'seven'
print(humanize.apnumber(41))  # '41'
github gil9red / SimplePyScripts / humanize__examples / integer__humanization.py View on Github external
import humanize


# Integer humanization:
print(humanize.intcomma(12345))      # '12,345'
print(humanize.intcomma(123456789))  # '123,456,789'
print()

print(humanize.intword(123455913))      # '123.5 million'
print(humanize.intword(12345591313))    # '12.3 billion'
print(humanize.intword(1339014900000))  # '1.3 trillion'
print()

print(humanize.apnumber(4))   # 'four'
print(humanize.apnumber(7))   # 'seven'
print(humanize.apnumber(41))  # '41'