Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Utilities for parsing strings into numbers, and printing numbers as pretty strings

Project Description

Strings to Numbers:

>>> from numutil import str2num, num2str
>>> str2num('1.3 million')
1300000
>>> str2num('three and a half')
Fraction(7, 2)
>>> str2num('123,456.789')
123456.789

Numbers to Strings:

>>> num2str(1234567, style='newspaper')
'1.23 million'
>>> num2str(1234567, style='words')
'one million, two hundred thirty four thousand, five hundred sixty seven'

numutil might be useful for people mining data from text, or for people running web apps that need to parse numbers from user-entered strings, or render numbers in a user-friendly format.

Release History

Release History

This version
History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
numutil-0.1.0.tar.gz (8.4 kB) Copy SHA256 Checksum SHA256 Source Feb 4, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting