You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

si-prefix

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

si-prefix

Functions for formatting numbers according to SI standards.


Maintainers
1

Readme

si_prefix

codecov

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.
  • 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

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc