From 9949d1248f4d86f0c33852d27d43623630efee9a Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 8 Mar 2026 00:27:17 +0000 Subject: [PATCH] Expose all data storage conversions --- hdyc-svelte/src/lib/data/calculators.ts | 48 ++++++++++++------------- migrate.py | 2 ++ 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/hdyc-svelte/src/lib/data/calculators.ts b/hdyc-svelte/src/lib/data/calculators.ts index b001662..d6ded5e 100644 --- a/hdyc-svelte/src/lib/data/calculators.ts +++ b/hdyc-svelte/src/lib/data/calculators.ts @@ -90,44 +90,44 @@ export const calculators: CalculatorDef[] = [ {"slug": "bits-to-words-32-bit", "name": "Bits to Words (32-bit)", "category": "data", "type": "standard", "teaser": "Show how many 32-bit words fit into a given bit count.", "labels": {"in1": "Bits", "in2": "Words (32-bit)"}, "factor": 0.03125}, {"slug": "bytes-to-words-16-bit", "name": "Bytes to Words (16-bit)", "category": "data", "type": "standard", "teaser": "Convert byte counts into 16-bit words for legacy units.", "labels": {"in1": "Bytes", "in2": "Words (16-bit)"}, "factor": 0.5}, {"slug": "bytes-to-words-32-bit", "name": "Bytes to Words (32-bit)", "category": "data", "type": "standard", "teaser": "Convert byte counts into 32-bit words for modern registers.", "labels": {"in1": "Bytes", "in2": "Words (32-bit)"}, "factor": 0.25}, - {"slug": "bits-to-kilobits", "name": "Bits to Kilobits", "category": "data", "type": "standard", "teaser": "Convert a bit count into kilobits for bandwidth planning.", "labels": {"in1": "Bits", "in2": "Kilobits"}, "factor": 0.001, "hidden": true}, + {"slug": "bits-to-kilobits", "name": "Bits to Kilobits", "category": "data", "type": "standard", "teaser": "Convert a bit count into kilobits for bandwidth planning.", "labels": {"in1": "Bits", "in2": "Kilobits"}, "factor": 0.001}, {"slug": "kilobits-to-bits", "name": "Kilobits to Bits", "category": "data", "type": "standard", "teaser": "Expand kilobits back into raw bits.", "labels": {"in1": "Kilobits", "in2": "Bits"}, "factor": 1000.0}, - {"slug": "bits-to-kibibits", "name": "Bits to Kibibits", "category": "data", "type": "standard", "teaser": "Use binary kibibit units when dealing with 1,024-based counts.", "labels": {"in1": "Bits", "in2": "Kibibits"}, "factor": 0.0009765625, "hidden": true}, + {"slug": "bits-to-kibibits", "name": "Bits to Kibibits", "category": "data", "type": "standard", "teaser": "Use binary kibibit units when dealing with 1,024-based counts.", "labels": {"in1": "Bits", "in2": "Kibibits"}, "factor": 0.0009765625}, {"slug": "kibibits-to-bits", "name": "Kibibits to Bits", "category": "data", "type": "standard", "teaser": "Translate kibibit counts into bits.", "labels": {"in1": "Kibibits", "in2": "Bits"}, "factor": 1024.0}, - {"slug": "bits-to-megabits", "name": "Bits to Megabits", "category": "data", "type": "standard", "teaser": "Describe bitstreams as megabits per second.", "labels": {"in1": "Bits", "in2": "Megabits"}, "factor": 1e-06, "hidden": true}, + {"slug": "bits-to-megabits", "name": "Bits to Megabits", "category": "data", "type": "standard", "teaser": "Describe bitstreams as megabits per second.", "labels": {"in1": "Bits", "in2": "Megabits"}, "factor": 1e-06}, {"slug": "megabits-to-bits", "name": "Megabits to Bits", "category": "data", "type": "standard", "teaser": "Turn megabit bandwidth into bits.", "labels": {"in1": "Megabits", "in2": "Bits"}, "factor": 1000000.0}, - {"slug": "bits-to-mebibits", "name": "Bits to Mebibits", "category": "data", "type": "standard", "teaser": "Map bits into mebibits for binary archive math.", "labels": {"in1": "Bits", "in2": "Mebibits"}, "factor": 9.5367431640625e-07, "hidden": true}, + {"slug": "bits-to-mebibits", "name": "Bits to Mebibits", "category": "data", "type": "standard", "teaser": "Map bits into mebibits for binary archive math.", "labels": {"in1": "Bits", "in2": "Mebibits"}, "factor": 9.5367431640625e-07}, {"slug": "mebibits-to-bits", "name": "Mebibits to Bits", "category": "data", "type": "standard", "teaser": "Expand mebibits into bits.", "labels": {"in1": "Mebibits", "in2": "Bits"}, "factor": 1048576.0}, - {"slug": "bits-to-gigabits", "name": "Bits to Gigabits", "category": "data", "type": "standard", "teaser": "Express bits as gigabits for wide-area planning.", "labels": {"in1": "Bits", "in2": "Gigabits"}, "factor": 1e-09, "hidden": true}, + {"slug": "bits-to-gigabits", "name": "Bits to Gigabits", "category": "data", "type": "standard", "teaser": "Express bits as gigabits for wide-area planning.", "labels": {"in1": "Bits", "in2": "Gigabits"}, "factor": 1e-09}, {"slug": "gigabits-to-bits", "name": "Gigabits to Bits", "category": "data", "type": "standard", "teaser": "Translate gigabit rates into raw bits per second.", "labels": {"in1": "Gigabits", "in2": "Bits"}, "factor": 1000000000.0}, - {"slug": "bits-to-gibibits", "name": "Bits to Gibibits", "category": "data", "type": "standard", "teaser": "Show bits in gibibit terms for binary telephony.", "labels": {"in1": "Bits", "in2": "Gibibits"}, "factor": 9.313225746154785e-10, "hidden": true}, + {"slug": "bits-to-gibibits", "name": "Bits to Gibibits", "category": "data", "type": "standard", "teaser": "Show bits in gibibit terms for binary telephony.", "labels": {"in1": "Bits", "in2": "Gibibits"}, "factor": 9.313225746154785e-10}, {"slug": "gibibits-to-bits", "name": "Gibibits to Bits", "category": "data", "type": "standard", "teaser": "Convert gibibits back to bits.", "labels": {"in1": "Gibibits", "in2": "Bits"}, "factor": 1073741824.0}, - {"slug": "bits-to-terabits", "name": "Bits to Terabits", "category": "data", "type": "standard", "teaser": "Scale bits to the terabit level for fiber budgets.", "labels": {"in1": "Bits", "in2": "Terabits"}, "factor": 1e-12, "hidden": true}, + {"slug": "bits-to-terabits", "name": "Bits to Terabits", "category": "data", "type": "standard", "teaser": "Scale bits to the terabit level for fiber budgets.", "labels": {"in1": "Bits", "in2": "Terabits"}, "factor": 1e-12}, {"slug": "terabits-to-bits", "name": "Terabits to Bits", "category": "data", "type": "standard", "teaser": "Turn terabit throughput into bits.", "labels": {"in1": "Terabits", "in2": "Bits"}, "factor": 1000000000000.0}, - {"slug": "bits-to-tebibits", "name": "Bits to Tebibits", "category": "data", "type": "standard", "teaser": "Fall into tebibit counts when evaluating tape.", "labels": {"in1": "Bits", "in2": "Tebibits"}, "factor": 9.094947017729282e-13, "hidden": true}, + {"slug": "bits-to-tebibits", "name": "Bits to Tebibits", "category": "data", "type": "standard", "teaser": "Fall into tebibit counts when evaluating tape.", "labels": {"in1": "Bits", "in2": "Tebibits"}, "factor": 9.094947017729282e-13}, {"slug": "tebibits-to-bits", "name": "Tebibits to Bits", "category": "data", "type": "standard", "teaser": "Translate tebibits back into bits.", "labels": {"in1": "Tebibits", "in2": "Bits"}, "factor": 1099511627776.0}, - {"slug": "bytes-to-kilobytes", "name": "Bytes to Kilobytes", "category": "data", "type": "standard", "teaser": "Summarize bytes as kilobytes for quick estimates.", "labels": {"in1": "Bytes", "in2": "Kilobytes"}, "factor": 0.001, "hidden": true}, + {"slug": "bytes-to-kilobytes", "name": "Bytes to Kilobytes", "category": "data", "type": "standard", "teaser": "Summarize bytes as kilobytes for quick estimates.", "labels": {"in1": "Bytes", "in2": "Kilobytes"}, "factor": 0.001}, {"slug": "kilobytes-to-bytes", "name": "Kilobytes to Bytes", "category": "data", "type": "standard", "teaser": "Expand kilobytes into raw bytes.", "labels": {"in1": "Kilobytes", "in2": "Bytes"}, "factor": 1000.0}, - {"slug": "bytes-to-kibibytes", "name": "Bytes to Kibibytes", "category": "data", "type": "standard", "teaser": "Use kibibytes by converting bytes with 1,024-based counts.", "labels": {"in1": "Bytes", "in2": "Kibibytes"}, "factor": 0.0009765625, "hidden": true}, + {"slug": "bytes-to-kibibytes", "name": "Bytes to Kibibytes", "category": "data", "type": "standard", "teaser": "Use kibibytes by converting bytes with 1,024-based counts.", "labels": {"in1": "Bytes", "in2": "Kibibytes"}, "factor": 0.0009765625}, {"slug": "kibibytes-to-bytes", "name": "Kibibytes to Bytes", "category": "data", "type": "standard", "teaser": "Convert kibibytes into bytes.", "labels": {"in1": "Kibibytes", "in2": "Bytes"}, "factor": 1024.0}, - {"slug": "bytes-to-megabytes", "name": "Bytes to Megabytes", "category": "data", "type": "standard", "teaser": "Turn bytes into megabytes for file-size labels.", "labels": {"in1": "Bytes", "in2": "Megabytes"}, "factor": 1e-06, "hidden": true}, + {"slug": "bytes-to-megabytes", "name": "Bytes to Megabytes", "category": "data", "type": "standard", "teaser": "Turn bytes into megabytes for file-size labels.", "labels": {"in1": "Bytes", "in2": "Megabytes"}, "factor": 1e-06}, {"slug": "bytes-to-mebibytes", "name": "Bytes to Mebibytes", "category": "data", "type": "standard", "teaser": "Express bytes as mebibytes when binary accuracy matters.", "labels": {"in1": "Bytes", "in2": "Mebibytes"}, "factor": 9.5367431640625e-07}, - {"slug": "bytes-to-gigabytes", "name": "Bytes to Gigabytes", "category": "data", "type": "standard", "teaser": "Scale bytes into gigabytes for storage quotes.", "labels": {"in1": "Bytes", "in2": "Gigabytes"}, "factor": 1e-09, "hidden": true}, + {"slug": "bytes-to-gigabytes", "name": "Bytes to Gigabytes", "category": "data", "type": "standard", "teaser": "Scale bytes into gigabytes for storage quotes.", "labels": {"in1": "Bytes", "in2": "Gigabytes"}, "factor": 1e-09}, {"slug": "bytes-to-gibibytes", "name": "Bytes to Gibibytes", "category": "data", "type": "standard", "teaser": "Convert bytes into gibibytes for precise quotas.", "labels": {"in1": "Bytes", "in2": "Gibibytes"}, "factor": 9.313225746154785e-10}, {"slug": "bytes-to-terabytes", "name": "Bytes to Terabytes", "category": "data", "type": "standard", "teaser": "Aggregate bytes into terabytes.", "labels": {"in1": "Bytes", "in2": "Terabytes"}, "factor": 1e-12}, {"slug": "bytes-to-tebibytes", "name": "Bytes to Tebibytes", "category": "data", "type": "standard", "teaser": "Translate bytes into tebibytes for tape libraries.", "labels": {"in1": "Bytes", "in2": "Tebibytes"}, "factor": 9.094947017729282e-13}, - {"slug": "kilobytes-to-kibibytes", "name": "Kilobytes to Kibibytes", "category": "data", "type": "standard", "teaser": "Switch kilobytes into kibibytes for binary storage conversions.", "labels": {"in1": "Kilobytes", "in2": "Kibibytes"}, "factor": 0.9765625, "hidden": true}, + {"slug": "kilobytes-to-kibibytes", "name": "Kilobytes to Kibibytes", "category": "data", "type": "standard", "teaser": "Switch kilobytes into kibibytes for binary storage conversions.", "labels": {"in1": "Kilobytes", "in2": "Kibibytes"}, "factor": 0.9765625}, {"slug": "kibibytes-to-kilobytes", "name": "Kibibytes to Kilobytes", "category": "data", "type": "standard", "teaser": "Translate kibibytes into kilobytes.", "labels": {"in1": "Kibibytes", "in2": "Kilobytes"}, "factor": 1.024}, - {"slug": "kilobytes-to-megabytes", "name": "Kilobytes to Megabytes", "category": "data", "type": "standard", "teaser": "Express kilobytes as megabytes for quick summaries.", "labels": {"in1": "Kilobytes", "in2": "Megabytes"}, "factor": 0.001, "hidden": true}, - {"slug": "kilobytes-to-mebibytes", "name": "Kilobytes to Mebibytes", "category": "data", "type": "standard", "teaser": "Turn kilobytes into mebibytes when power-of-two precision is needed.", "labels": {"in1": "Kilobytes", "in2": "Mebibytes"}, "factor": 0.00095367431640625, "hidden": true}, + {"slug": "kilobytes-to-megabytes", "name": "Kilobytes to Megabytes", "category": "data", "type": "standard", "teaser": "Express kilobytes as megabytes for quick summaries.", "labels": {"in1": "Kilobytes", "in2": "Megabytes"}, "factor": 0.001}, + {"slug": "kilobytes-to-mebibytes", "name": "Kilobytes to Mebibytes", "category": "data", "type": "standard", "teaser": "Turn kilobytes into mebibytes when power-of-two precision is needed.", "labels": {"in1": "Kilobytes", "in2": "Mebibytes"}, "factor": 0.00095367431640625}, {"slug": "mebibytes-to-kilobytes", "name": "Mebibytes to Kilobytes", "category": "data", "type": "standard", "teaser": "Convert mebibytes into kilobytes.", "labels": {"in1": "Mebibytes", "in2": "Kilobytes"}, "factor": 1048.576}, - {"slug": "kilobytes-to-gigabytes", "name": "Kilobytes to Gigabytes", "category": "data", "type": "standard", "teaser": "Scale kilobytes up to gigabytes.", "labels": {"in1": "Kilobytes", "in2": "Gigabytes"}, "factor": 1e-06, "hidden": true}, + {"slug": "kilobytes-to-gigabytes", "name": "Kilobytes to Gigabytes", "category": "data", "type": "standard", "teaser": "Scale kilobytes up to gigabytes.", "labels": {"in1": "Kilobytes", "in2": "Gigabytes"}, "factor": 1e-06}, {"slug": "gigabytes-to-kilobytes", "name": "Gigabytes to Kilobytes", "category": "data", "type": "standard", "teaser": "Reframe gigabytes in kilobyte units.", "labels": {"in1": "Gigabytes", "in2": "Kilobytes"}, "factor": 1000000.0}, - {"slug": "kilobytes-to-gibibytes", "name": "Kilobytes to Gibibytes", "category": "data", "type": "standard", "teaser": "Turn kilobytes into gibibytes.", "labels": {"in1": "Kilobytes", "in2": "Gibibytes"}, "factor": 9.313225746154785e-07, "hidden": true}, + {"slug": "kilobytes-to-gibibytes", "name": "Kilobytes to Gibibytes", "category": "data", "type": "standard", "teaser": "Turn kilobytes into gibibytes.", "labels": {"in1": "Kilobytes", "in2": "Gibibytes"}, "factor": 9.313225746154785e-07}, {"slug": "gibibytes-to-kilobytes", "name": "Gibibytes to Kilobytes", "category": "data", "type": "standard", "teaser": "Expand gibibytes back into kilobytes.", "labels": {"in1": "Gibibytes", "in2": "Kilobytes"}, "factor": 1073741.824}, - {"slug": "kilobytes-to-terabytes", "name": "Kilobytes to Terabytes", "category": "data", "type": "standard", "teaser": "Scale kilobytes into terabytes.", "labels": {"in1": "Kilobytes", "in2": "Terabytes"}, "factor": 1e-09, "hidden": true}, + {"slug": "kilobytes-to-terabytes", "name": "Kilobytes to Terabytes", "category": "data", "type": "standard", "teaser": "Scale kilobytes into terabytes.", "labels": {"in1": "Kilobytes", "in2": "Terabytes"}, "factor": 1e-09}, {"slug": "terabytes-to-kilobytes", "name": "Terabytes to Kilobytes", "category": "data", "type": "standard", "teaser": "Re-express terabytes as kilobytes.", "labels": {"in1": "Terabytes", "in2": "Kilobytes"}, "factor": 1000000000.0}, - {"slug": "kilobytes-to-tebibytes", "name": "Kilobytes to Tebibytes", "category": "data", "type": "standard", "teaser": "Convert kilobytes into tebibytes.", "labels": {"in1": "Kilobytes", "in2": "Tebibytes"}, "factor": 9.094947017729282e-10, "hidden": true}, + {"slug": "kilobytes-to-tebibytes", "name": "Kilobytes to Tebibytes", "category": "data", "type": "standard", "teaser": "Convert kilobytes into tebibytes.", "labels": {"in1": "Kilobytes", "in2": "Tebibytes"}, "factor": 9.094947017729282e-10}, {"slug": "tebibytes-to-kilobytes", "name": "Tebibytes to Kilobytes", "category": "data", "type": "standard", "teaser": "Translate tebibytes into kilobytes.", "labels": {"in1": "Tebibytes", "in2": "Kilobytes"}, "factor": 1099511627.776}, {"slug": "megabytes-to-gibibytes", "name": "Megabytes to Gibibytes", "category": "data", "type": "standard", "teaser": "Compare megabytes with gibibytes for mixed units.", "labels": {"in1": "Megabytes", "in2": "Gibibytes"}, "factor": 0.0009313225746154785}, {"slug": "btu-to-kilojoules", "name": "BTU to Kilojoules", "category": "energy", "type": "standard", "labels": {"in1": "BTU", "in2": "Kilojoules"}, "factor": 1.05505585}, @@ -552,7 +552,7 @@ export const calculators: CalculatorDef[] = [ {"slug": "millimeters-to-centimeters", "name": "Millimeters to Centimeters", "category": "length", "type": "standard", "labels": {"in1": "Millimeters", "in2": "Centimeters"}, "factor": 0.1, "hidden": true}, {"slug": "millimeters-to-inches", "name": "Millimeters to Inches", "category": "length", "type": "standard", "labels": {"in1": "Millimeters", "in2": "Inches"}, "factor": 0.0393701}, {"slug": "millimeters-to-thou", "name": "Millimeters to Thou", "category": "length", "type": "standard", "teaser": "Express millimeters as mils/thou (1 mil = 0.0254 mm).", "labels": {"in1": "Millimeters", "in2": "Thou"}, "factor": 39.3701}, - {"slug": "megabytes-to-gigabytes", "name": "Megabytes to Gigabytes", "category": "data", "type": "standard", "labels": {"in1": "Megabytes", "in2": "Gigabytes"}, "factor": 0.001, "hidden": true}, + {"slug": "megabytes-to-gigabytes", "name": "Megabytes to Gigabytes", "category": "data", "type": "standard", "labels": {"in1": "Megabytes", "in2": "Gigabytes"}, "factor": 0.001}, {"slug": "megajoules-to-kilowatt-hours", "name": "Megajoules to Kilowatt-hours", "category": "energy", "type": "standard", "labels": {"in1": "Megajoules", "in2": "Kilowatt-hours"}, "factor": 0.277778, "hidden": true}, {"slug": "meters-to-feet", "name": "Meters to Feet", "category": "length", "type": "standard", "labels": {"in1": "Meters", "in2": "Feet"}, "factor": 3.28084}, {"slug": "meters-to-yards", "name": "Meters to Yards", "category": "length", "type": "standard", "labels": {"in1": "Meters", "in2": "Yards"}, "factor": 1.09361}, @@ -611,17 +611,17 @@ export const calculators: CalculatorDef[] = [ {"slug": "milliliters-to-teaspoons", "name": "Milliliters to Teaspoons", "category": "volume", "type": "standard", "labels": {"in1": "Milliliters", "in2": "Teaspoons"}, "factor": 0.202884, "hidden": true}, {"slug": "millimeters-to-microns", "name": "Millimeters to Microns", "category": "length", "type": "standard", "labels": {"in1": "Millimeters", "in2": "Microns"}, "factor": 1000.0}, {"slug": "femtograms-to-attograms", "name": "Femtograms to Attograms", "category": "weight", "type": "standard", "labels": {"in1": "Femtograms", "in2": "Attograms"}, "factor": 1000.0}, - {"slug": "gigabytes-to-terabytes", "name": "Gigabytes to Terabytes", "category": "data", "type": "standard", "labels": {"in1": "Gigabytes", "in2": "Terabytes"}, "factor": 0.001, "hidden": true}, + {"slug": "gigabytes-to-terabytes", "name": "Gigabytes to Terabytes", "category": "data", "type": "standard", "labels": {"in1": "Gigabytes", "in2": "Terabytes"}, "factor": 0.001}, {"slug": "maxwell-to-weber", "name": "Maxwell to Weber", "category": "magnetism", "type": "standard", "teaser": "Convert CGS magnetic flux (maxwell) into SI webers.", "labels": {"in1": "Maxwell", "in2": "Weber"}, "factor": 1e-08}, {"slug": "mbps-to-gbps", "name": "Mbps to Gbps", "category": "other", "type": "standard", "teaser": "Convert megabits per second into gigabits per second.", "labels": {"in1": "Mbps", "in2": "Gbps"}, "factor": 0.001, "hidden": true}, {"slug": "mbps-to-kbps", "name": "Mbps to Kbps", "category": "other", "type": "standard", "teaser": "Convert megabits per second into kilobits per second.", "labels": {"in1": "Mbps", "in2": "Kbps"}, "factor": 1000.0}, {"slug": "mbps-to-mb-per-second", "name": "Mbps to MB/s", "category": "other", "type": "standard", "teaser": "Convert megabits per second into megabytes per second.", "labels": {"in1": "Mbps", "in2": "MB/s"}, "factor": 0.125}, {"slug": "mebibytes-to-megabytes", "name": "Mebibytes to Megabytes", "category": "data", "type": "standard", "teaser": "Convert mebibytes into megabytes.", "labels": {"in1": "Mebibytes", "in2": "Megabytes"}, "factor": 1.048576}, - {"slug": "megabits-to-gigabits", "name": "Megabits to Gigabits", "category": "data", "type": "standard", "teaser": "Convert megabits into gigabits.", "labels": {"in1": "Megabits", "in2": "Gigabits"}, "factor": 0.001, "hidden": true}, + {"slug": "megabits-to-gigabits", "name": "Megabits to Gigabits", "category": "data", "type": "standard", "teaser": "Convert megabits into gigabits.", "labels": {"in1": "Megabits", "in2": "Gigabits"}, "factor": 0.001}, {"slug": "megabits-to-kilobits", "name": "Megabits to Kilobits", "category": "data", "type": "standard", "teaser": "Convert megabits into kilobits.", "labels": {"in1": "Megabits", "in2": "Kilobits"}, "factor": 1000.0}, {"slug": "megabytes-to-bytes", "name": "Megabytes to Bytes", "category": "data", "type": "standard", "teaser": "A download weighs 5 megabytes; how many bytes does that represent?", "labels": {"in1": "Megabytes", "in2": "Bytes"}, "factor": 1000000.0}, {"slug": "megabytes-to-kilobytes", "name": "Megabytes to Kilobytes", "category": "data", "type": "standard", "teaser": "A file is 3 megabytes; how many kilobytes is that?", "labels": {"in1": "Megabytes", "in2": "Kilobytes"}, "factor": 1000.0}, - {"slug": "megabytes-to-mebibytes", "name": "Megabytes to Mebibytes", "category": "data", "type": "standard", "teaser": "Convert megabytes into mebibytes.", "labels": {"in1": "Megabytes", "in2": "Mebibytes"}, "factor": 0.95367431640625, "hidden": true}, + {"slug": "megabytes-to-mebibytes", "name": "Megabytes to Mebibytes", "category": "data", "type": "standard", "teaser": "Convert megabytes into mebibytes.", "labels": {"in1": "Megabytes", "in2": "Mebibytes"}, "factor": 0.95367431640625}, {"slug": "megabytes-to-terabytes", "name": "Megabytes to Terabytes", "category": "data", "type": "standard", "teaser": "Convert megabytes into terabytes.", "labels": {"in1": "Megabytes", "in2": "Terabytes"}, "factor": 1e-06}, {"slug": "megahertz-to-gigahertz", "name": "Megahertz to Gigahertz", "category": "other", "type": "standard", "teaser": "A radio tuned to 100 MHz is what frequency in GHz?", "labels": {"in1": "Megahertz", "in2": "Gigahertz"}, "factor": 0.001, "hidden": true}, {"slug": "megahertz-to-kilohertz", "name": "Megahertz to Kilohertz", "category": "other", "type": "standard", "teaser": "Express megahertz as kilohertz.", "labels": {"in1": "Megahertz", "in2": "Kilohertz"}, "factor": 1000.0}, @@ -1173,7 +1173,7 @@ export const calculators: CalculatorDef[] = [ {"slug": "gibibytes-to-gigabytes", "name": "Gibibytes to Gigabytes", "category": "data", "type": "standard", "teaser": "A backup file is 2 GiB; how many gigabytes will the storage quota show?", "labels": {"in1": "Gibibytes", "in2": "Gigabytes"}, "factor": 1.073741824}, {"slug": "gigabits-to-megabits", "name": "Gigabits to Megabits", "category": "data", "type": "standard", "teaser": "A carrier promises 3 gigabits per second; how many megabits is the link rated for?", "labels": {"in1": "Gigabits", "in2": "Megabits"}, "factor": 1000.0}, {"slug": "gigabytes-to-bytes", "name": "Gigabytes to Bytes", "category": "data", "type": "standard", "teaser": "A download weighs 5 gigabytes; how many bytes does that represent?", "labels": {"in1": "Gigabytes", "in2": "Bytes"}, "factor": 1000000000.0}, - {"slug": "gigabytes-to-gibibytes", "name": "Gigabytes to Gibibytes", "category": "data", "type": "standard", "teaser": "A storage plan advertises 1,000 GB; how many gibibytes is that?", "labels": {"in1": "Gigabytes", "in2": "Gibibytes"}, "factor": 0.9313225746154785, "hidden": true}, + {"slug": "gigabytes-to-gibibytes", "name": "Gigabytes to Gibibytes", "category": "data", "type": "standard", "teaser": "A storage plan advertises 1,000 GB; how many gibibytes is that?", "labels": {"in1": "Gigabytes", "in2": "Gibibytes"}, "factor": 0.9313225746154785}, {"slug": "gigabytes-to-petabytes", "name": "Gigabytes to Petabytes", "category": "data", "type": "standard", "teaser": "A data warehouse holds 400,000 gigabytes; how many petabytes is that?", "labels": {"in1": "Gigabytes", "in2": "Petabytes"}, "factor": 1e-06}, {"slug": "gigahertz-to-megahertz", "name": "Gigahertz to Megahertz", "category": "other", "type": "standard", "teaser": "A processor is rated at 3 GHz; how many megahertz is that clock speed?", "labels": {"in1": "Gigahertz", "in2": "Megahertz"}, "factor": 1000.0}, {"slug": "gill-to-milliliters", "name": "Gill to Milliliters", "category": "volume", "type": "standard", "teaser": "A bartender pours two US gills; how many milliliters should the glass hold?", "labels": {"in1": "Gill", "in2": "Milliliters"}, "factor": 118.294}, diff --git a/migrate.py b/migrate.py index 1d1a1b0..7f8a61c 100644 --- a/migrate.py +++ b/migrate.py @@ -278,6 +278,8 @@ def process(): for e in calculators_ts_entries: # Check if inverse exists. We hide the one with the smaller factor (usually < 1) or hide alphabetical later one. # But a better heuristic: reverse of split(' to ') + if e.get('category') == 'data': + continue parsed = split_conversion_name(e['name']) if parsed: rev_name = f"{parsed[1]} to {parsed[0]}"