Functions for formatting numbers according to SI standards.
Project description
si_prefix
Functions for formatting numbers according to SI standards.
Example usage:
from si_prefix import si_format
print si_format(.5)
# 500.0 m (default precision is 1)
print si_format(.01331, precision=2)
# 13.31 m
print si_format(1331, precision=2)
# 1.33 k
print si_format(1331, precision=0)
# 1 k
Changelog
- 1.0: use unicode strings and use µ (i.e.,
\N{MICRO SIGN}
) to denote micro (not u).- Note: switching to unicode strings is an API-breaking change and may
break code expecting a
str
return type. - See issue #4 for more details.
- Note: switching to unicode strings is an API-breaking change and may
break code expecting a
- 0.5: change license to 3-clause BSD
- 0.4.1: add space before unit prefix
- 0.4: add Python 3 support,
si_parse
function - 0.2: bug fixes
- 0.1: initial release
Credits
Written by Christian Fobel christian@fobel.net
Ported from C version written by Jukka “Yucca” Korpela jkorpela@cs.tut.fi.
Contributors
Python 3 support: olehermanse
License
This project is licensed under the terms of the BSD 3-clause license
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
si_prefix-1.3.2.tar.gz
(20.6 kB
view hashes)
Built Distribution
Close
Hashes for si_prefix-1.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45430b91a7169f8e52598e309f95b350f7b886a23a118eefafdc7a6b0529836b |
|
MD5 | 588c4d26af121fd0861989f58d261f73 |
|
BLAKE2b-256 | ac4cb69e6c42bd80472b4359c43ff3b5933fa526a19ec33368a58b65ebb58396 |