English conversion from number to string
Project description
[WIP] shortscale
Python module to convert numbers into English words.
This is the Python port of the shortscale function, originally written in JavaScript and Rust, documented here. There is a also a Go version.
The short scale, has different words for each power of 1000.
This implementation expresses numbers from zero to thousands, millions, billions, trillions, and quadrillions, up to 999_999_999_999_999_999.
Function
def shortscale(num: int) -> str
Example
import shortscale
// ==> four hundred and twenty billion nine hundred and ninety nine thousand and fifteen
print(shortscale.shortscale(420_000_999_015))
After installing this module, the function can also be called from the commnd line e.g.
shortscale 420_000_999_015
Benchmarks
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
shortscale-0.1.0.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for shortscale-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38a84b7831dfa6ef1a376f9e26b9210a20c30c7e99d1b9ed1e4135eb11a56e6b |
|
MD5 | d5737a0ae178aba77af5de83d277d9a4 |
|
BLAKE2b-256 | 838d11b7d8bec95f303b06ac625de05da8031e263f26887ae2e33094d078c9b2 |