Command line tool for getting answers to everyday questions like:
whats 2 meters in feet... or more importantly:
whats 1.21 gigawatts in wattsThis tool is in its very early stages and right now primarily a finger exercise for me while getting into Zig.
Usage: whats [OPTION]... EXPRESSION
A command for basic convertion and calculation.
-h, --help display this help and exit
-v, --version output version information and exit
Units:
Symbol Name
--------------------------------------------------------------------------------
MONEY:
EUR EUR
USD USD
JPY JPY
CZK CZK
DKK DKK
GBP GBP
HUF HUF
PLN PLN
RON RON
SEK SEK
CHF CHF
ISK ISK
NOK NOK
TRY TRY
AUD AUD
BRL BRL
CAD CAD
CNY CNY
HKD HKD
IDR IDR
ILS ILS
INR INR
KRW KRW
MXN MXN
MYR MYR
NZD NZD
PHP PHP
SGD SGD
THB THB
ZAR ZAR
DATA:
b bit
Kb kilobit
Mb megabit
Gb gigabit
Tb terabit
Pb petabit
Eb exabit
Zb zettabit
Yb yottabit
B byte
KB kilobyte
MB megabyte
GB gigabyte
TB terabyte
PB petabyte
EB exabyte
ZB zettabyte
YB yottabyte
KiB kibibyte
MiB mebibyte
GiB gibibyte
TiB tebibyte
PiB pebibyte
EiB exbibyte
ZiB zebibyte
YiB yobibyte
ENERGY:
J joule
qJ quectojoule
rJ rontojoule
yJ yoctojoule
zJ zeptojoule
aJ attojoule
fJ femtojoule
pJ picojoule
nJ nanojoule
µJ microjoule
mJ millijoule
cJ centijoule
dJ decijoule
daJ decajoule
hJ hectojoule
kJ kilojoule
MJ megajoule
GJ gigajoule
TJ terajoule
PJ petajoule
EJ exajoule
ZJ zettajoule
YJ yottajoule
RJ ronnajoule
QJ quettajoule
Wh watthour
kWh kilowatthour
MWh megawatthour
GWh gigawatthour
TWh terawatthour
PWh petawatthour
eV electronvolt
cal calorie
LENGTH:
m meter
am attometer
fm femtometer
pm picometer
nm nanometer
µm micrometer
mm millimeter
cm centimeter
dm decimeter
dam decameter
hm hectometer
km kilometer
Mm megameter
Gm gigameter
Tm terameter
Pm petameter
Em exameter
Å angstrom
in inch
ft foot
yd yard
mi mile
nmi nauticalmile
lea league
fur furlong
MASS:
g gram
qg quectogram
rg rontogram
yg yoctogram
zg zeptogram
ag attogram
fg femtogram
pg picogram
ng nanogram
µg microgram
mg milligram
cg centigram
dg decigram
dag decagram
hg hectogram
kg kilogram
Mg megagram
Gg gigagram
Tg teragram
Pg petagram
Eg exagram
Zg zettagram
Yg yottagram
Rg ronnagram
Qg quettagram
gr grain
dr drachm
oz ounce
lb pound
st stone
t ton
slug
POWER:
W watt
qW quectowatt
rW rontowatt
yW yoctowatt
zW zeptowatt
aW attowatt
fW femtowatt
pW picowatt
nW nanowatt
µW microwatt
mW milliwatt
cW centiwatt
dW deciwatt
daW decawatt
hW hectowatt
kW kilowatt
MW megawatt
GW gigawatt
TW terawatt
PW petawatt
EW exawatt
ZW zettawatt
YW yottawatt
RW ronnawatt
QW quettawatt
PRESSURE:
Pa pascal
qPa quectopascal
rPa rontopascal
yPa yoctopascal
zPa zeptopascal
aPa attopascal
fPa femtopascal
pPa picopascal
nPa nanopascal
µPa micropascal
mPa millipascal
cPa centipascal
dPa decipascal
daPa decapascal
hPa hectopascal
kPa kilopascal
MPa megapascal
GPa gigapascal
TPa terapascal
PPa petapascal
EPa exapascal
ZPa zettapascal
YPa yottapascal
RPa ronnapascal
QPa quettapascal
mbar millibar
cbar centibar
dbar decibar
bar bar
kbar kilobar
Mbar megabar
Gbar gigabar
at technicalatmosphere
atm standardatmosphere
Ba barye
inH2O inchofwatercolumn
mH2O meterofwatercolumn
inHg inchofmercury
mmHg millimeterofmercury
N/m² newtonpersquaremeter
psi poundforcepersquareinch
Torr torr
TEMPERATURE:
C celsius
F fahrenheit
K kelvin
TIME:
s second
qs quectosecond
rs rontosecond
ys yoctosecond
zs zeptosecond
as attosecond
fs femtosecond
ps picosecond
ns nanosecond
µs microsecond
ms millisecond
cs centisecond
ds decisecond
das decasecond
hs hectosecond
ks kilosecond
Ms megasecond
Gs gigasecond
Ts terasecond
Ps petasecond
Es exasecond
Zs zettasecond
Ys yottasecond
Rs ronnasecond
Qs quettasecond
min minute
hr hour
d day
month
yr year
decade
century
millennium
𝑡ₚ plancktime
fortnight
score
VELOCITY:
m/s meterpersecond
km/h kilometerperhour
mph milesperhour
ft/s footpersecond
kn knot
VOLUME:
L liter
qL quectoliter
rL rontoliter
yL yoctoliter
zL zeptoliter
aL attoliter
fL femtoliter
pL picoliter
nL nanoliter
µL microliter
mL milliliter
cL centiliter
dL deciliter
daL decaliter
hL hectoliter
kL kiloliter
ML megaliter
GL gigaliter
TL teraliter
PL petaliter
EL exaliter
ZL zettaliter
YL yottaliter
RL ronnaliter
QL quettaliter
minim
qt quart
pt pint
gal gallon
floz fluidounce
fldr usfluiddram
tsp teaspoon
tbsp tablespoon
uspt uspint
usqt usquart
pot uspottle
usgal usgallon
usfloz usfluidounce
c uscup
jig usshot
gi usgill
bbl barrel
oilbarrel
hogshead
CALCULATION:
% percent
--------------------------------------------------------------------------------
Note:
Symbols are case-sensitive, names are not.
Operators:
in: Conversion, e.g. 2m in feet
to: Conversion or calculation, e.g. 2m to feet, 10 to 20
of: Calculation, e.g. 20% of 100, 20 of 100
Math operators:
plus, + Addition, e.g. 1 plus 2, 1 + 2
minus, - Subtraction, e.g. 10 minus 6, 10 - 6
times, x, *, × Multiplication, e.g. 3 times 2, 3 multiplied by 2
by, divided, /, ÷ Division, e.g. 15 by 3, 15 divided by 3
power, ^, ** Exponentiation, e.g. 10 ^ 4, 2 to the power of 10
The operator is optional when units are present:
whats 2 m ft
whats 10% 100
Examples:
whats 2 meters in feet
whats 1.21 gigawatts in watts
whats 8 kg in grams
whats 1024 KiB in MiB
whats 3 times 2
whats 10 + 5
whats 15.4 divided by 2
whats 100 km per hour in mph
Multiplication:
whats 2 + 2 x 4
whats "(2 + 1) x 3"
Quote what the shell would otherwise expand, such as * and parentheses:
whats "4 * 3"
Units take part in arithmetic:
whats 2 m + 30 cm in ft
whats "(1 GB + 500 MB) in MB"
whats 100 km/h x 2
A percentage applies to the value on its left:
whats 100 + 10%
whats 100 - 10%
whats 100 x 10%
Compound units can be written as:
whats 100 km/h in mph
whats 100 mph in knots
Spaces are optional:
whats 2m ft
whats 1+1
Numbers may be signed or written in exponent notation:
whats -5 + 3
whats 1.5e-4 m in mm
Report bugs at: https://tty.fail/mrus/whats/issues
Home page: http://xn--gckvb8fzb.com/projects/whats/
