units
Constants
- Fixed point unit constants:
n
,u
,m
,k
,K
,G
,T
andP
. - Power of 2 unit constants:
Ki
,Mi
,Gi
,Ti
andPi
.
Functions
to_n(num: int) -> str
Int literal to string withn
suffixto_u(num: int) -> str
Int literal to string withu
suffixto_m(num: int) -> str
Int literal to string withm
suffixto_K(num: int) -> str
Int literal to string withK
suffixto_M(num: int) -> str
Int literal to string withM
suffixto_G(num: int) -> str
Int literal to string withG
suffixto_T(num: int) -> str
Int literal to string withT
suffixto_P(num: int) -> str
Int literal to string withP
suffixto_Ki(num: int) -> str
Int literal to string withKi
suffixto_Mi(num: int) -> str
Int literal to string withMi
suffixto_Gi(num: int) -> str
Int literal to string withGi
suffixto_Ti(num: int) -> str
Int literal to string withTi
suffixto_Pi(num: int) -> str
Int literal to string withPi
suffix
import units
# SI
n = units.to_n(1e-9)
u = units.to_u(1e-6)
m = units.to_m(1e-1)
K = units.to_K(1000)
M = units.to_M(1000000)
G = units.to_G(1000000000)
T = units.to_T(1000000000000)
P = units.to_P(1000000000000000)
# IEC
Ki = units.to_Ki(1024)
Mi = units.to_Mi(1024 ** 2)
Gi = units.to_Gi(1024 ** 3)
Ti = units.to_Ti(1024 ** 4)
Pi = units.to_Pi(1024 ** 5)