From b5d889cf1fa7099ceb47b2c07fcb6113f6fb7171 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Mon, 22 Mar 2021 19:50:36 -0400 Subject: [PATCH] Add some QUIRKY units --- macrovision.js | 74 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 68 insertions(+), 6 deletions(-) diff --git a/macrovision.js b/macrovision.js index af65d81c..7eea5c72 100644 --- a/macrovision.js +++ b/macrovision.js @@ -197,31 +197,74 @@ math.createUnit("peopleEaten", { prefixes: "long" }) +math.createUnit("barn", { + definition: "10e-28 m^2", + prefixes: "long" +}) +math.createUnit("barns", { + definition: "10e-28 m^2", + prefixes: "long" +}) + +math.createUnit("beardSeconds", { + definition: "10 nanometers", + prefixes: "long" +}) +math.createUnit("smoots", { + definition: "5.5833333 feet", + prefixes: "long" +}) +math.createUnit("furlongs", { + definition: "660 feet", + prefixes: "long" +}) +math.createUnit("nanoacres", { + definition: "1e-9 acres", + prefixes: "long" +}) +math.createUnit("barnMegaparsecs", { + definition: "barn megaparsec", + prefixes: "long" +}) +math.createUnit("firkins", { + definition: "90 lb", + prefixes: "long" +}) +math.createUnit("donkeySeconds", { + definition: "250 joules", + prefixes: "long" +}) + const defaultUnits = { length: { metric: "meters", customary: "feet", - relative: "stories" + relative: "stories", + quirky: "smoots" }, area: { metric: "meters^2", customary: "feet^2", - relative: "footballFields" + relative: "footballFields", + quirky: "nanoacres" }, volume: { metric: "liters", customary: "gallons", - relative: "olympicPools" + relative: "olympicPools", + volume: "barnmegaparsecs" }, mass: { metric: "kilograms", customary: "lbs", - relative: "peopleMass" + relative: "peopleMass", + quirky: "firkins" }, energy: { metric: "kJ", customary: "kcal", - relative: "peopleEaten" + relative: "peopleEaten", + quirky: "donkeySeconds" } } @@ -251,6 +294,11 @@ const unitChoices = { "galaxies", "universes", "multiverses" + ], + "quirky": [ + "beardSeconds", + "smoots", + "furlongs" ] }, area: { @@ -266,6 +314,10 @@ const unitChoices = { ], "relative": [ "footballFields" + ], + "quirky": [ + "barns", + "nanoacres" ] }, volume: { @@ -288,6 +340,9 @@ const unitChoices = { "earthVolumes", "universeVolumes", "multiverseVolumes", + ], + "quirky": [ + "barnMegaparsecs" ] }, mass: { @@ -308,6 +363,9 @@ const unitChoices = { "buses", "earthMass", "solarmasses" + ], + "quirky": [ + "firkins" ] }, energy: { @@ -321,6 +379,9 @@ const unitChoices = { ], "relative": [ "peopleEaten" + ], + "quirky": [ + "donkeySeconds" ] } } @@ -1969,7 +2030,8 @@ const settingsData = { options: [ "metric", "customary", - "relative" + "relative", + "quirky" ], get value() { return config.units;