Unit converter in JavaScript.
npm i Zhiro990/Unit-Converterconst UnitConverter = require("Unit-Converter");convertData() : number
| Parameter | Description | Type | Optional |
|---|---|---|---|
from |
The original unit you want to convert. | string | No |
to |
The target unit for conversion. | string | No |
number |
The value you want to convert. | number | No |
convertLength() : number
| Parameter | Description | Type | Optional |
|---|---|---|---|
from |
The original unit you want to convert. | string | No |
to |
The target unit for conversion. | string | No |
number |
The value you want to convert. | number | No |
convertMass() : number
| Parameter | Description | Type | Optional |
|---|---|---|---|
from |
The original unit you want to convert. | string | No |
to |
The target unit for conversion. | string | No |
number |
The value you want to convert. | number | No |
convertTemperature() : number
| Parameter | Description | Type | Optional |
|---|---|---|---|
from |
The original unit you want to convert. | string | No |
to |
The target unit for conversion. | string | No |
number |
The value you want to convert. | number | No |
convertTime() : number
| Parameter | Description | Type | Optional |
|---|---|---|---|
from |
The original unit you want to convert. | string | No |
to |
The target unit for conversion. | string | No |
number |
The value you want to convert. | number | No |
| Unit | Name |
|---|---|
QiB |
Quebibyte |
RiB |
Robibyte |
YiB |
Yobibyte |
ZiB |
Zebibyte |
EiB |
Exbibyte |
PiB |
Pebibyte |
TiB |
Tebibyte |
GiB |
Gibibyte |
MiB |
Mebibyte |
KiB |
Kibibyte |
QB |
Quettabyte |
RB |
Ronnabyte |
YB |
Yottabyte |
ZB |
Zettabyte |
EB |
Exabyte |
PB |
Petabyte |
TB |
Terabyte |
GB |
Gigabyte |
MB |
Megabyte |
KB |
Kilobyte |
B |
Byte |
Qib |
Quebibit |
Rib |
Robibit |
Yib |
Yobibit |
Zib |
Zebibit |
Eib |
Exbibit |
Pib |
Pebibit |
Tib |
Tebibit |
Gib |
Gibibit |
Mib |
Mebibit |
Kib |
Kibibit |
Qb |
Quettabit |
Rb |
Ronnabit |
Yb |
Yottabit |
Zb |
Zettabit |
Eb |
Exabit |
Pb |
Petabit |
Tb |
Terabit |
Gb |
Gigabit |
Mb |
Megabit |
Kb |
Kilobit |
b |
Bit |
| Unit | Name |
|---|---|
km |
Kilometer |
hm |
Hectometer |
dam |
Decameter |
m |
Meter |
dm |
Decimeter |
cm |
Centimeter |
mm |
Millimeter |
in |
Inch |
ft |
Foot/Feet |
yd |
Yard |
mi |
Mile |
| Unit | Name |
|---|---|
Gt |
Gigatonne |
Mt |
Megatonne |
kt |
Kilotonne |
t |
Tonne |
q |
Quintal |
kg |
Kilogram |
g |
Gram |
mg |
Milligram |
lb |
Pound |
oz |
Ounce |
gr |
Grain |
ct |
Carat |
| Unit | Name |
|---|---|
C |
Celcius |
F |
Fahrenheit |
K |
Kelvin |
R |
Rankine |
Re |
Réaumur |
| Unit | Name |
|---|---|
yr |
Year |
mo |
Month |
wk |
Week |
d |
Day |
h |
Hour |
min |
Minute |
s |
Second |
ms |
Millisecond |