Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bastosmichael/1b62e6cab37b30e94aae459764542a0b to your computer and use it in GitHub Desktop.
Save bastosmichael/1b62e6cab37b30e94aae459764542a0b to your computer and use it in GitHub Desktop.
const liters = {canonical: 'liters',
metric: [{type: 'milliliters',
to: {divide: 1000},
from: {multiply: 1000}},
{type: 'centiliters',
to: {divide: 100},
from: {multiply: 100}},
{type: 'deciliters',
to: {divide: 10},
from: {multiply: 10}},
{type: 'liters',
to: {divide: 1},
from: {multiply: 1}},
{type: 'dekaliters',
to: {multiply: 10},
from: {divide: 10}},
{type: 'hectoliters',
to: {multiply: 100},
from: {divide: 100}},
{type: 'kiloliters',
to: {multiply: 1000},
from: {divide: 1000}}],
standard: [{type: 'fluid ounces',
to: {divide: 33.814},
from: {multiply: 33.814}},
{type: 'gills',
to: {divide: 8.454},
from: {multiply: 8.454}},
{type: 'pints',
to: {divide: 2.113},
from: {multiply: 2.113}},
{type: 'quarts',
to: {divide: 1.057},
from: {multiply: 1.057}},
{type: 'gallons',
to: {multiply: 3.785},
from: {divide: 3.785}}]};
const meters = {canonical: 'meters',
metric: [{type: 'millimeters',
to: {divide: 1000},
from: {multiply: 1000}},
{type: 'centimeters',
to: {divide: 100},
from: {multiply: 100}},
{type: 'decimeters',
to: {divide: 10},
from: {multiply: 10}},
{type: 'meters',
to: {divide: 1},
from: {multiply: 1}},
{type: 'dekameters',
to: {multiply: 10},
from: {divide: 10}},
{type: 'hectometers',
to: {multiply: 100},
from: {divide: 100}},
{type: 'kilometers',
to: {multiply: 1000},
from: {divide: 1000}}],
standard: [{type: 'inches',
to: {divide: 39.37},
from: {multiply: 39.37}},
{type: 'feet',
to: {divide: 3.281},
from: {multiply: 3.281}},
{type: 'yards',
to: {divide: 1.094},
from: {multiply: 1.094}},
{type: 'miles',
to: {multiply: 1609},
from: {divide: 1609}}]};
const meters_squared = {canonical: 'meters squared',
metric: [{type: 'sq millimeters',
to: {divide: 1000000},
from: {multiply: 1000000}},
{type: 'sq centimeters',
to: {divide: 10000},
from: {multiply: 10000}},
{type: 'sq decimeters',
to: {divide: 100},
from: {multiply: 100}},
{type: 'meters squared',
to: {divide: 1},
from: {multiply: 1}},
{type: 'sq dekameters',
to: {multiply: 100},
from: {divide: 100}},
{type: 'sq hectometers',
to: {multiply: 10000},
from: {divide: 10000}},
{type: 'sq kilometers',
to: {multiply: 1000000},
from: {divide: 1000000}}],
standard: [{type: 'sq inches',
to: {divide: 1550},
from: {multiply: 1550}},
{type: 'sq feet',
to: {divide: 10.764},
from: {multiply: 10.764}},
{type: 'sq yards',
to: {divide: 1.196},
from: {multiply: 1.196}},
{type: 'sq miles',
to: {multiply: 0.00000259},
from: {divide: 0.00000259}}]};
const meters_cubed = { canonical: 'meters cubed',
metric: [{type: 'cu millimeters',
to: {divide: 1000000000},
from: {multiply: 1000000000}},
{type: 'cu centimeters',
to: {divide: 1000000},
from: {multiply: 1000000}},
{type: 'cu decimeters',
to: {divide: 1000},
from: {multiply: 1000}},
{type: 'meters cubed',
to: {divide: 1},
from: {multiply: 1}},
{type: 'cu dekameters',
to: {multiply: 1000},
from: {divide: 1000}},
{type: 'cu hectometers',
to: {multiply: 1000000},
from: {divide: 1000000}},
{type: 'cu kilometers',
to: {multiply: 1000000000},
from: {divide: 1000000000}}],
standard: [{type: 'cu inches',
to: {divide: 61024},
from: {multiply: 61024}},
{type: 'cu feet',
to: {divide: 35.315},
from: {multiply: 35.315}},
{type: 'cu yards',
to: {divide: 1.308},
from: {multiply: 1.308}},
{type: 'cu miles',
to: {multiply: 4168000000},
from: {divide: 4168000000}}]};
const metric_tons = { canonical: 'metric tons',
metric: [{type: 'milligrams',
to: {divide: 1000000000},
from: {multiply: 1000000000}},
{type: 'centigrams',
to: {divide: 100000000},
from: {multiply: 100000000}},
{type: 'decigrams',
to: {divide: 10000000},
from: {multiply: 10000000}},
{type: 'grams',
to: {divide: 1000000},
from: {multiply: 1000000}},
{type: 'dekagrams',
to: {divide: 100000},
from: {multiply: 100000}},
{type: 'hectograms',
to: {divide: 10000},
from: {multiply: 10000}},
{type: 'kilograms',
to: {divide: 1000},
from: {multiply: 1000}},
{type: 'metric tons',
to: {multiply: 1},
from: {divide: 1}}],
standard: [{type: 'ounces',
to: {divide: 35274},
from: {multiply: 35274}},
{type: 'pounds',
to: {divide: 2205},
from: {multiply: 2205}},
{type: 'tons',
to: {divide: 1.102},
from: {multiply: 1.102}}]};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment