Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_apnumber(test_input, expected):
assert humanize.apnumber(test_input) == expected
# 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'
# 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'
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'