Skip to main content

FaSt_PUC converts numbers to strings with appropriate unit prefix.

Project description

FaSt_PUC

FaSt_PUC is a pretty unit converter. It creates a string with suitable metric prefix.

Written by Fabian Stutzki, fast@fast-apps.de

Licensed under MIT

Usage

Import the package and call the main function:

from fast_puc import puc

puc(1.0001)  # "1"
puc(1.0001, "m")  # "1m"
puc(0.991e-6, "s")  # "991ns"
puc(1030e-9, "m")  # "1.03µm"

PUC supports some special characters:

puc(1.0001, " m")  # "1 m"  # with space separator
puc(1.0001, "_m")  # "1_m"  # with underscore separator
puc(0.911, "%")  # "91.1%"  # convert to percent
puc(1001, "dB")  # "30dB"  # convert to dB
puc(1030e-9, "!m")  # "1p03um"  # file name compatible

Project details


Download files

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

Source Distribution

fast_puc-0.2.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

fast_puc-0.2.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file fast_puc-0.2.0.tar.gz.

File metadata

  • Download URL: fast_puc-0.2.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/24.0.0

File hashes

Hashes for fast_puc-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ab5ebc888e6a325fc1f72cd10d827bb3a3280a0ac1e97491670ba66929f4b548
MD5 304ee1d05e85517bd9f219fb06e15935
BLAKE2b-256 a3992537636e5aa2e7312e44a43c4449f7258fb451202f1ad3dd98b24ffb488b

See more details on using hashes here.

File details

Details for the file fast_puc-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fast_puc-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/24.0.0

File hashes

Hashes for fast_puc-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ef70c4c294062b6be761e81c68f20d8ea6c1bf7850c7a29b58cd2efe001b103
MD5 379f8b262eb28d86a67e150a5ed18f72
BLAKE2b-256 72c62fc66e1bd364840e592c4a1afd016619c480c97b8f1f3555464a7a6005f6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page