Supported Exponent Replacements
sciform
offers exponent replacement modes which provide
translations between exponent strings and conventional alphabetic
symbol representations.
For decimal exponents in engineering formats, SI prefix translations are
available according to the
SI prefixes.
It is also possible to convert decimal exponents into
parts-per notation.
For binary formats, the IEC prefix translations are available matched to
integer multiples of 10 according to the
IEC prefixes.
SI Prefixes
Exponent Value |
Prefix Name |
Prefix |
---|---|---|
10+30 |
Quetta |
Q |
10+27 |
Ronna |
R |
10+24 |
Yotta |
Y |
10+21 |
Zetta |
Z |
10+18 |
Exa |
E |
10+15 |
Peta |
P |
10+12 |
Tera |
T |
10+9 |
Giga |
G |
10+6 |
Mega |
M |
10+3 |
kilo |
k |
10-3 |
milli |
m |
10-6 |
micro |
µ |
10-9 |
nano |
n |
10-12 |
pico |
p |
10-15 |
femto |
f |
10-18 |
atto |
a |
10-21 |
zepto |
z |
10-24 |
yocto |
y |
10-27 |
ronto |
r |
10-30 |
quecto |
q |
Extra SI Prefixes
The user can additionally add the following extra si prefixes using the Extra Exponent Replacements options:
Exponent Value |
Prefix Name |
Prefix |
---|---|---|
10+2 |
hecto |
h |
10+1 |
deca |
da |
10-1 |
deci |
d |
10-2 |
centi |
c |
Parts Per Forms
Exponent Value |
Prefix Name |
Prefix |
---|---|---|
100 |
unity |
|
10-6 |
parts-per-million |
ppm |
10-9 |
parts-per-billion |
ppb |
10-12 |
parts-per-trillion |
ppt |
10-15 |
parts-per-quadrillion |
ppq |
The user can additionally add a parts-per-thousand form ppth
corresponding to 10-3 using the add_ppth_form
option.
Note that the definitions here conform to the
short scale
naming convention for large numbers, but that some locales use the
long scale
naming convention for large numbers.
These two scales disagree on the numerical values for terms like
“billion” and “trillion”.
For this reason, the usage of this notation is sometimes discouraged.
Note that it is possible, using the extra_parts_per_forms
option to
override the standard mappings listed above.
>>> from sciform import Formatter
>>> formatter = Formatter(
... exp_mode="engineering",
... exp_format="parts_per",
... extra_parts_per_forms={-9: None, -12: "ppb"},
... )
>>> print(formatter(33e-9))
33e-09
>>> print(formatter(33e-12))
33 ppb
IEC Prefixes
Exponent Value |
Prefix Name |
Prefix |
---|---|---|
2+80 |
yobi |
Yi |
2+70 |
zebi |
Zi |
2+60 |
exi |
Ei |
2+50 |
pebi |
Pi |
2+40 |
tebi |
Ti |
2+30 |
gibi |
Gi |
2+20 |
mebi |
Mi |
2+10 |
kibi |
Ki |