Fix unit definitions and sync registry
This commit is contained in:
@@ -63,17 +63,21 @@ export const calculators: CalculatorDef[] = [
|
||||
{"slug": "attograms-to-femtograms", "name": "Attograms to Femtograms", "category": "weight", "type": "standard", "teaser": "To compare particle masses, convert 150 attograms into femtograms.", "labels": {"in1": "Attograms", "in2": "Femtograms"}, "factor": 0.001, "hidden": true},
|
||||
{"slug": "bar-to-pascal", "name": "Bar to Pascal", "category": "pressure", "type": "standard", "labels": {"in1": "Bar", "in2": "Pascal"}, "factor": 100000.0},
|
||||
{"slug": "bar-to-psi", "name": "Bar to PSI", "category": "pressure", "type": "standard", "labels": {"in1": "Bar", "in2": "PSI"}, "factor": 14.5037738},
|
||||
{"slug": "pascal-to-barye", "name": "Pascal to Barye", "category": "pressure", "type": "standard", "teaser": "Convert pascals into CGS barye units for historical reference.", "labels": {"in1": "Pascal", "in2": "Barye"}, "factor": 10.0},
|
||||
{"slug": "pascal-to-bar", "name": "Pascal to Bar", "category": "pressure", "type": "standard", "teaser": "Convert pascals back into bars for quick pressure comparisons.", "labels": {"in1": "Pascal", "in2": "Bar"}, "factor": 1e-05, "hidden": true},
|
||||
{"slug": "pascal-to-dynes-per-sq-cm", "name": "Pascal to Dynes per sq cm", "category": "force", "type": "standard", "teaser": "Translate SI pressure into CGS dynes per square centimeter.", "labels": {"in1": "Pascal", "in2": "Dynes per sq cm"}, "factor": 10.0},
|
||||
{"slug": "pascal-to-kpa", "name": "Pascal to kPa", "category": "pressure", "type": "standard", "teaser": "Convert pascals into kilopascals.", "labels": {"in1": "Pascal", "in2": "kPa"}, "factor": 0.001, "hidden": true},
|
||||
{"slug": "pascal-to-megapascals", "name": "Pascal to Megapascals", "category": "pressure", "type": "standard", "teaser": "Express pascals as megapascals.", "labels": {"in1": "Pascal", "in2": "Megapascals"}, "factor": 1e-06, "hidden": true},
|
||||
{"slug": "pascal-to-mmhg", "name": "Pascal to mmHg", "category": "pressure", "type": "standard", "teaser": "Turn pascals into millimeters of mercury.", "labels": {"in1": "Pascal", "in2": "mmHg"}, "factor": 0.00750062},
|
||||
{"slug": "pascal-to-psi", "name": "Pascal to PSI", "category": "pressure", "type": "standard", "teaser": "Convert pascals to pounds per square inch.", "labels": {"in1": "Pascal", "in2": "PSI"}, "factor": 0.000145038},
|
||||
{"slug": "pascal-to-psi", "name": "Pascal to PSI", "category": "pressure", "type": "standard", "teaser": "Convert pascals to pounds per square inch.", "labels": {"in1": "Pascal", "in2": "PSI"}, "factor": 0.000145038, "hidden": true},
|
||||
{"slug": "pascal-to-technical-atmosphere", "name": "Pascal to Technical atmosphere", "category": "pressure", "type": "standard", "teaser": "Convert pascals to technical atmospheres (kgf/cm\u00b2).", "labels": {"in1": "Pascal", "in2": "Technical atmosphere"}, "factor": 1.0197162e-05},
|
||||
{"slug": "pascal-to-torr", "name": "Pascal to Torr", "category": "pressure", "type": "standard", "teaser": "Convert pascals into torr for vacuum work.", "labels": {"in1": "Pascal", "in2": "Torr"}, "factor": 0.00750062, "hidden": true},
|
||||
{"slug": "pascal-seconds-to-centipoise", "name": "Pascal-seconds to Centipoise", "category": "pressure", "type": "standard", "teaser": "Convert Pascal-second viscosity into centipoise.", "labels": {"in1": "Pascal-seconds", "in2": "Centipoise"}, "factor": 1000.0},
|
||||
{"slug": "poise-to-pascal-seconds", "name": "Poise to Pascal-seconds", "category": "pressure", "type": "standard", "teaser": "Express CGS poise viscosity in Pascal-seconds.", "labels": {"in1": "Poise", "in2": "Pascal-seconds"}, "factor": 0.1},
|
||||
{"slug": "becquerel-to-curie", "name": "Becquerel to Curie", "category": "radiation", "type": "standard", "labels": {"in1": "Becquerel", "in2": "Curie"}, "factor": 2.7027027e-11, "hidden": true},
|
||||
{"slug": "becquerel-to-rutherford", "name": "Becquerel to Rutherford", "category": "radiation", "type": "standard", "labels": {"in1": "Becquerel", "in2": "Rutherford"}, "factor": 1e-06, "hidden": true},
|
||||
{"slug": "bits-to-bytes", "name": "Bits to Bytes", "category": "data", "type": "standard", "labels": {"in1": "Bits", "in2": "Bytes"}, "factor": 0.1},
|
||||
{"slug": "nibbles-to-bits", "name": "Nibbles to Bits", "category": "data", "type": "standard", "teaser": "Each 4-bit nibble stores exactly four bits in digital streams.", "labels": {"in1": "Nibbles", "in2": "Bits"}, "factor": 4.0},
|
||||
{"slug": "words-16-bit-to-bits", "name": "Words (16-bit) to Bits", "category": "data", "type": "standard", "teaser": "Convert 16-bit words into raw bits for archive calculations.", "labels": {"in1": "Words (16-bit)", "in2": "Bits"}, "factor": 16.0},
|
||||
{"slug": "words-16-bit-to-bytes", "name": "Words (16-bit) to Bytes", "category": "data", "type": "standard", "teaser": "Express a 16-bit word as a pair of bytes.", "labels": {"in1": "Words (16-bit)", "in2": "Bytes"}, "factor": 2.0},
|
||||
{"slug": "words-32-bit-to-bits", "name": "Words (32-bit) to Bits", "category": "data", "type": "standard", "teaser": "Convert 32-bit words into bits for framing larger registers.", "labels": {"in1": "Words (32-bit)", "in2": "Bits"}, "factor": 32.0},
|
||||
@@ -97,7 +101,8 @@ export const calculators: CalculatorDef[] = [
|
||||
{"slug": "amps-to-watts", "name": "Amps to Watts", "category": "power", "type": "3col-mul", "labels": {"in1": "Amps", "in2": "Watts", "in3": "Volts"}},
|
||||
{"slug": "amps-to-kilowatts", "name": "Amps to Kilowatts", "category": "power", "type": "3col", "labels": {"in1": "Amps", "in2": "Kilowatts", "in3": "Volts"}},
|
||||
{"slug": "amps-to-kva", "name": "Amps to kVA", "category": "electrical", "type": "3col", "labels": {"in1": "Amps", "in2": "kVA", "in3": "Result"}},
|
||||
{"slug": "ampere-turns-per-meter-to-oersted", "name": "Ampere-turns per meter to Oersted", "category": "length", "type": "standard", "teaser": "Convert magnetomotive force per meter into oersted units.", "labels": {"in1": "Ampere-turns per meter", "in2": "Oersted"}, "factor": 0.0125663706143592},
|
||||
{"slug": "ampere-turns-per-meter-to-oersted", "name": "Ampere-turns per meter to Oersted", "category": "length", "type": "standard", "teaser": "Convert magnetomotive force per meter into oersted units.", "labels": {"in1": "Ampere-turns per meter", "in2": "Oersted"}, "factor": 0.0125663706143592, "hidden": true},
|
||||
{"slug": "oersted-to-ampere-turns-per-meter", "name": "Oersted to Ampere-turns per meter", "category": "length", "type": "standard", "teaser": "Flip the CGS oersted field scale back into ampere-turns per meter.", "labels": {"in1": "Oersted", "in2": "Ampere-turns per meter"}, "factor": 79.57747154594767},
|
||||
{"slug": "amps-to-milliamps", "name": "Amps to Milliamps", "category": "electrical", "type": "standard", "teaser": "Translate amperes into milliamperes when tuning circuit currents.", "labels": {"in1": "Amps", "in2": "Milliamps"}, "factor": 1000.0},
|
||||
{"slug": "carats-to-grams", "name": "Carats to Grams", "category": "weight", "type": "standard", "labels": {"in1": "Carats", "in2": "Grams"}, "factor": 0.2, "hidden": true},
|
||||
{"slug": "celsius-to-fahrenheit", "name": "Celsius to Fahrenheit", "category": "temperature", "type": "standard", "labels": {"in1": "Celsius", "in2": "Fahrenheit"}, "factor": 1.8, "offset": 32.0},
|
||||
@@ -207,6 +212,10 @@ export const calculators: CalculatorDef[] = [
|
||||
{"slug": "dynes-to-pound-force", "name": "Dynes to Pound-force", "category": "force", "type": "standard", "teaser": "Turn dynes into the more intuitive pound-force units.", "labels": {"in1": "Dynes", "in2": "Pound-force"}, "factor": 2.248089431128759e-06, "hidden": true},
|
||||
{"slug": "dynes-to-kilonewtons", "name": "Dynes to Kilonewtons", "category": "force", "type": "standard", "teaser": "Scale dynes all the way into kilonewtons for SI reporting.", "labels": {"in1": "Dynes", "in2": "Kilonewtons"}, "factor": 1e-08, "hidden": true},
|
||||
{"slug": "ounces-to-grams", "name": "Ounces to Grams", "category": "weight", "type": "standard", "labels": {"in1": "Ounces", "in2": "Grams"}, "factor": 28.3495},
|
||||
{"slug": "ounces-to-grains", "name": "Ounces to Grains", "category": "weight", "type": "standard", "teaser": "Convert avoirdupois ounces into grains.", "labels": {"in1": "Ounces", "in2": "Grains"}, "factor": 437.5},
|
||||
{"slug": "ounces-to-kilograms", "name": "Ounces to Kilograms", "category": "weight", "type": "standard", "teaser": "Express avoirdupois ounces in kilograms.", "labels": {"in1": "Ounces", "in2": "Kilograms"}, "factor": 0.0283495},
|
||||
{"slug": "ounces-to-milligrams", "name": "Ounces to Milligrams", "category": "weight", "type": "standard", "teaser": "Move ounces into milligram measurements.", "labels": {"in1": "Ounces", "in2": "Milligrams"}, "factor": 28349.523125},
|
||||
{"slug": "ounces-to-troy-ounces", "name": "Ounces to Troy Ounces", "category": "weight", "type": "standard", "teaser": "Convert avoirdupois ounces into troy ounces.", "labels": {"in1": "Ounces", "in2": "Troy Ounces"}, "factor": 0.9114583333333333},
|
||||
{"slug": "kilogram-force-meters-to-dyne-centimeters", "name": "Kilogram-force Meters to Dyne-centimeters", "category": "force", "type": "standard", "teaser": "Flip kilogram-force meters back into dyne-centimeters.", "labels": {"in1": "Kilogram-force Meters", "in2": "Dyne-centimeters"}, "factor": 98066500.0},
|
||||
{"slug": "kilogram-force-meters-to-foot-pounds", "name": "Kilogram-force Meters to Foot-pounds", "category": "force", "type": "standard", "teaser": "Express a kilogram-force meter as foot-pounds of torque.", "labels": {"in1": "Kilogram-force Meters", "in2": "Foot-pounds"}, "factor": 7.233013851209897},
|
||||
{"slug": "kilogram-force-meters-to-inch-pounds", "name": "Kilogram-force Meters to Inch-pounds", "category": "force", "type": "standard", "teaser": "Turn a kilogram-force meter into inch-pounds.", "labels": {"in1": "Kilogram-force Meters", "in2": "Inch-pounds"}, "factor": 86.79616621451876},
|
||||
@@ -262,8 +271,12 @@ export const calculators: CalculatorDef[] = [
|
||||
{"slug": "kilowatt-hours-to-megajoules", "name": "Kilowatt-hours to Megajoules", "category": "energy", "type": "standard", "labels": {"in1": "Kilowatt-hours", "in2": "Megajoules"}, "factor": 3.6},
|
||||
{"slug": "knots-to-miles-per-hour", "name": "Knots to Miles per hour", "category": "length", "type": "standard", "labels": {"in1": "Knots", "in2": "Miles per hour"}, "factor": 1.15077945},
|
||||
{"slug": "light-years-to-astronomical-units", "name": "Light years to Astronomical units", "category": "time", "type": "standard", "labels": {"in1": "Light years", "in2": "Astronomical units"}, "factor": 63241.077},
|
||||
{"slug": "light-years-to-parsecs", "name": "Light years to Parsecs", "category": "time", "type": "standard", "labels": {"in1": "Light years", "in2": "Parsecs"}, "factor": 0.306601394},
|
||||
{"slug": "light-years-to-parsecs", "name": "Light years to Parsecs", "category": "time", "type": "standard", "labels": {"in1": "Light years", "in2": "Parsecs"}, "factor": 0.306601394, "hidden": true},
|
||||
{"slug": "liters-per-second-to-gallons-per-minute", "name": "Liters per second to Gallons per minute", "category": "volume", "type": "standard", "labels": {"in1": "Liters per second", "in2": "Gallons per minute"}, "factor": 15.8503231},
|
||||
{"slug": "parsecs-to-astronomical-units", "name": "Parsecs to Astronomical Units", "category": "other", "type": "standard", "teaser": "Translate parsec distances into astronomical units.", "labels": {"in1": "Parsecs", "in2": "Astronomical Units"}, "factor": 206265.0},
|
||||
{"slug": "parsecs-to-kilometers", "name": "Parsecs to Kilometers", "category": "length", "type": "standard", "teaser": "Turn parsecs into kilometers for cosmic scales.", "labels": {"in1": "Parsecs", "in2": "Kilometers"}, "factor": 30856775814913.7},
|
||||
{"slug": "parsecs-to-light-years", "name": "Parsecs to Light Years", "category": "time", "type": "standard", "teaser": "Express parsecs as light years.", "labels": {"in1": "Parsecs", "in2": "Light Years"}, "factor": 3.261563777},
|
||||
{"slug": "parsecs-to-miles", "name": "Parsecs to Miles", "category": "length", "type": "standard", "teaser": "Express parsecs in statute miles.", "labels": {"in1": "Parsecs", "in2": "Miles"}, "factor": 19181367000000.0},
|
||||
{"slug": "liters-to-gallons", "name": "Liters to Gallons", "category": "volume", "type": "standard", "labels": {"in1": "Liters", "in2": "Gallons"}, "factor": 0.264172052, "hidden": true},
|
||||
{"slug": "liters-to-pints", "name": "Liters to Pints", "category": "volume", "type": "standard", "labels": {"in1": "Liters", "in2": "Pints"}, "factor": 2.11337642},
|
||||
{"slug": "liters-to-quarts", "name": "Liters to Quarts", "category": "volume", "type": "standard", "labels": {"in1": "Liters", "in2": "Quarts"}, "factor": 1.05668821},
|
||||
@@ -280,6 +293,9 @@ export const calculators: CalculatorDef[] = [
|
||||
{"slug": "decimal-to-octal", "name": "Decimal to Octal", "category": "number-systems", "type": "standard", "labels": {"in1": "Decimal", "in2": "Octal"}},
|
||||
{"slug": "hex-to-binary", "name": "Hex to Binary", "category": "number-systems", "type": "base", "labels": {"in1": "Hex", "in2": "Binary"}, "toBase": 2, "fromBase": 16, "hidden": true},
|
||||
{"slug": "hex-to-decimal", "name": "Hex to Decimal", "category": "number-systems", "type": "standard", "labels": {"in1": "Hex", "in2": "Decimal"}, "hidden": true},
|
||||
{"slug": "octal-to-binary", "name": "Octal to Binary", "category": "number-systems", "type": "standard", "teaser": "Convert base-8 numbers into binary digits.", "labels": {"in1": "Octal", "in2": "Binary"}},
|
||||
{"slug": "octal-to-decimal", "name": "Octal to Decimal", "category": "number-systems", "type": "standard", "teaser": "Convert base-8 digits into decimal values.", "labels": {"in1": "Octal", "in2": "Decimal"}, "hidden": true},
|
||||
{"slug": "octal-to-hex", "name": "Octal to Hex", "category": "number-systems", "type": "standard", "teaser": "Express octal numbers as hexadecimal.", "labels": {"in1": "Octal", "in2": "Hex"}, "hidden": true},
|
||||
{"slug": "watts-to-amps", "name": "Watts to amps", "category": "power", "type": "3col", "labels": {"in1": "Watts", "in2": "amps", "in3": "Volts"}, "hidden": true},
|
||||
{"slug": "volts-to-amps", "name": "Volts to amps", "category": "electrical", "type": "3col", "labels": {"in1": "Volts", "in2": "amps", "in3": "Result"}, "hidden": true},
|
||||
{"slug": "volts-to-abvolts", "name": "Volts to Abvolts", "category": "electrical", "type": "standard", "teaser": "Convert SI volts into CGS abvolts.", "labels": {"in1": "Volts", "in2": "Abvolts"}, "factor": 100000000.0},
|
||||
@@ -341,16 +357,39 @@ export const calculators: CalculatorDef[] = [
|
||||
{"slug": "rad-to-gray", "name": "Rad to gray", "category": "radiation", "type": "standard", "labels": {"in1": "Rad", "in2": "gray"}, "factor": 0.01, "hidden": true},
|
||||
{"slug": "psi-to-megapascals", "name": "PSI to megapascals", "category": "pressure", "type": "standard", "labels": {"in1": "PSI", "in2": "megapascals"}, "factor": 0.006895, "hidden": true},
|
||||
{"slug": "psi-to-bar", "name": "PSI to bar", "category": "pressure", "type": "standard", "labels": {"in1": "PSI", "in2": "bar"}, "factor": 0.068948, "hidden": true},
|
||||
{"slug": "psi-to-kpa", "name": "PSI to kPa", "category": "pressure", "type": "standard", "teaser": "Convert pounds per square inch into kilopascals.", "labels": {"in1": "PSI", "in2": "kPa"}, "factor": 6.89476},
|
||||
{"slug": "psi-to-pascal", "name": "PSI to Pascals", "category": "pressure", "type": "standard", "teaser": "Convert PSI into pascals for SI clarity.", "labels": {"in1": "PSI", "in2": "Pascals"}, "factor": 6894.76},
|
||||
{"slug": "psi-to-mmhg", "name": "PSI to mmHg", "category": "pressure", "type": "standard", "teaser": "Express PSI in millimeters of mercury.", "labels": {"in1": "PSI", "in2": "mmHg"}, "factor": 51.7149},
|
||||
{"slug": "psi-to-torr", "name": "PSI to Torr", "category": "pressure", "type": "standard", "teaser": "Express PSI in torr for vacuum work.", "labels": {"in1": "PSI", "in2": "Torr"}, "factor": 51.7149},
|
||||
{"slug": "ppi-to-dpi", "name": "PPI to DPI", "category": "other", "type": "standard", "labels": {"in1": "PPI", "in2": "DPI"}},
|
||||
{"slug": "pounds-to-tons", "name": "Pounds to tons", "category": "weight", "type": "standard", "labels": {"in1": "Pounds", "in2": "tons"}, "factor": 0.0005, "hidden": true},
|
||||
{"slug": "pounds-to-stones", "name": "Pounds to stones", "category": "weight", "type": "standard", "labels": {"in1": "Pounds", "in2": "stones"}, "factor": 0.071428, "hidden": true},
|
||||
{"slug": "pounds-to-ounces", "name": "Pounds to ounces", "category": "weight", "type": "standard", "labels": {"in1": "Pounds", "in2": "ounces"}, "factor": 16.0},
|
||||
{"slug": "pounds-to-kilograms", "name": "Pounds to kilograms", "category": "weight", "type": "standard", "labels": {"in1": "Pounds", "in2": "kilograms"}, "factor": 0.45359, "hidden": true},
|
||||
{"slug": "pints-to-liters", "name": "Pints to liters", "category": "volume", "type": "standard", "labels": {"in1": "Pints", "in2": "liters"}, "factor": 0.473176, "hidden": true},
|
||||
{"slug": "pints-to-cups", "name": "Pints to Cups", "category": "volume", "type": "standard", "teaser": "Convert pints into cups for cooking measures.", "labels": {"in1": "Pints", "in2": "Cups"}, "factor": 2.0},
|
||||
{"slug": "pints-to-gallons", "name": "Pints to Gallons", "category": "volume", "type": "standard", "teaser": "Convert pints into gallons for volume tracking.", "labels": {"in1": "Pints", "in2": "Gallons"}, "factor": 0.125, "hidden": true},
|
||||
{"slug": "pints-to-quarts", "name": "Pints to Quarts", "category": "volume", "type": "standard", "teaser": "Convert pints into quarts for canning ratios.", "labels": {"in1": "Pints", "in2": "Quarts"}, "factor": 0.5},
|
||||
{"slug": "percent-to-ppm", "name": "Percent to PPM", "category": "other", "type": "standard", "labels": {"in1": "Percent", "in2": "PPM"}, "factor": 10000.0},
|
||||
{"slug": "percent-abv-to-proof", "name": "Percent ABV to Proof", "category": "other", "type": "standard", "teaser": "Convert alcohol by volume into US proof values (Proof = 2 \u00d7 ABV).", "labels": {"in1": "Percent ABV", "in2": "Proof"}, "factor": 2.0},
|
||||
{"slug": "proof-to-percent-abv", "name": "Proof to Percent ABV", "category": "other", "type": "standard", "teaser": "Convert US proof back into ABV (ABV = Proof / 2).", "labels": {"in1": "Proof", "in2": "Percent ABV"}, "factor": 0.5, "hidden": true},
|
||||
{"slug": "ppb-to-ppm", "name": "PPB to PPM", "category": "other", "type": "standard", "teaser": "Convert parts per billion into ppm.", "labels": {"in1": "PPB", "in2": "PPM"}, "factor": 0.001, "hidden": true},
|
||||
{"slug": "ppm-to-mg-per-liter", "name": "PPM to mg/L", "category": "other", "type": "standard", "teaser": "For dilute aqueous solutions, treat ppm as mg per liter.", "labels": {"in1": "PPM", "in2": "mg/L"}},
|
||||
{"slug": "ppm-to-percent", "name": "PPM to Percent", "category": "other", "type": "standard", "teaser": "Convert ppm values into percent by mass.", "labels": {"in1": "PPM", "in2": "Percent"}, "factor": 0.0001, "hidden": true},
|
||||
{"slug": "ppm-to-ppb", "name": "PPM to PPB", "category": "other", "type": "standard", "teaser": "Convert parts per million into parts per billion.", "labels": {"in1": "PPM", "in2": "PPB"}, "factor": 1000.0},
|
||||
{"slug": "planck-mass-to-kilograms", "name": "Planck mass to Kilograms", "category": "weight", "type": "standard", "teaser": "Convert the Planck mass into SI kilograms.", "labels": {"in1": "Planck mass", "in2": "Kilograms"}, "factor": 2.176434e-08},
|
||||
{"slug": "planck-time-to-seconds", "name": "Planck time to Seconds", "category": "time", "type": "standard", "teaser": "Express Planck time in seconds.", "labels": {"in1": "Planck time", "in2": "Seconds"}, "factor": 5.391247e-44},
|
||||
{"slug": "points-compass-to-degrees", "name": "Points (compass) to Degrees", "category": "angle", "type": "standard", "teaser": "Convert compass points into degrees.", "labels": {"in1": "Points (compass)", "in2": "Degrees"}, "factor": 11.25},
|
||||
{"slug": "points-to-inches", "name": "Points to Inches", "category": "length", "type": "standard", "teaser": "Translate typography points into inches for layout work.", "labels": {"in1": "Points", "in2": "Inches"}, "factor": 0.0138889, "hidden": true},
|
||||
{"slug": "points-to-pixels", "name": "Points to Pixels", "category": "other", "type": "standard", "teaser": "Convert typographic points into CSS pixels at 96 DPI.", "labels": {"in1": "Points", "in2": "Pixels"}, "factor": 1.333333},
|
||||
{"slug": "pixels-per-centimeter-to-dpi", "name": "Pixels per centimeter to DPI", "category": "length", "type": "standard", "teaser": "Convert pixels per centimeter into dots per inch (multiplying by 2.54).", "labels": {"in1": "Pixels per centimeter", "in2": "DPI"}, "factor": 2.54},
|
||||
{"slug": "pixels-to-points", "name": "Pixels to Points", "category": "other", "type": "standard", "teaser": "Convert CSS pixels into typographic points at 96 DPI.", "labels": {"in1": "Pixels", "in2": "Points"}, "factor": 0.75, "hidden": true},
|
||||
{"slug": "pennyweights-to-grams", "name": "Pennyweights to grams", "category": "weight", "type": "standard", "labels": {"in1": "Pennyweights", "in2": "grams"}, "factor": 1.55517},
|
||||
{"slug": "pennyweights-to-troy-ounces", "name": "Pennyweights to Troy Ounces", "category": "weight", "type": "standard", "teaser": "Convert pennyweights into troy ounces (1 pennyweight = 0.05 troy ounces).", "labels": {"in1": "Pennyweights", "in2": "Troy Ounces"}, "factor": 0.05},
|
||||
{"slug": "picocurie-to-becquerel", "name": "Picocurie to Becquerel", "category": "radiation", "type": "standard", "teaser": "A tiny radiation dose expressed in picocuries converts to becquerels.", "labels": {"in1": "Picocurie", "in2": "Becquerel"}, "factor": 0.037},
|
||||
{"slug": "picofarads-to-microfarads", "name": "Picofarads to Microfarads", "category": "radiation", "type": "standard", "teaser": "Convert tiny capacitances into microfarads for circuit design.", "labels": {"in1": "Picofarads", "in2": "Microfarads"}, "factor": 1e-06, "hidden": true},
|
||||
{"slug": "picograms-to-nanograms", "name": "Picograms to Nanograms", "category": "weight", "type": "standard", "teaser": "Express picogram masses as nanograms for lab reporting.", "labels": {"in1": "Picograms", "in2": "Nanograms"}, "factor": 0.001, "hidden": true},
|
||||
{"slug": "picometers-to-angstroms", "name": "Picometers to Angstroms", "category": "length", "type": "standard", "teaser": "Translate picometers into angstroms for nanoscale distances.", "labels": {"in1": "Picometers", "in2": "Angstroms"}, "factor": 0.01},
|
||||
{"slug": "pascals-to-inches-of-water", "name": "Pascals to inches of water", "category": "length", "type": "standard", "labels": {"in1": "Pascals", "in2": "inches of water"}, "factor": 0.004015, "hidden": true},
|
||||
{"slug": "pascals-to-inches-of-mercury", "name": "Pascals to inches of mercury", "category": "length", "type": "standard", "labels": {"in1": "Pascals", "in2": "inches of mercury"}, "factor": 0.000295, "hidden": true},
|
||||
{"slug": "pascal-to-atmosphere", "name": "Pascal to atmosphere", "category": "pressure", "type": "standard", "labels": {"in1": "Pascal", "in2": "atmosphere"}, "factor": 9.869e-06},
|
||||
@@ -360,7 +399,8 @@ export const calculators: CalculatorDef[] = [
|
||||
{"slug": "nanograms-to-picograms", "name": "Nanograms to picograms", "category": "weight", "type": "standard", "labels": {"in1": "Nanograms", "in2": "picograms"}, "factor": 1000.0},
|
||||
{"slug": "metric-tons-to-long-tons", "name": "Metric tons to long tons", "category": "weight", "type": "standard", "labels": {"in1": "Metric tons", "in2": "long tons"}, "factor": 0.9842},
|
||||
{"slug": "lumens-to-candela", "name": "Lumens to candela", "category": "light", "type": "standard", "labels": {"in1": "Lumens", "in2": "candela"}, "factor": 0.079577, "hidden": true},
|
||||
{"slug": "gsm-to-ounces-per-sq-yard", "name": "GSM to Ounces per sq yard", "category": "length", "type": "standard", "teaser": "Convert GSM to Ounces per sq yard instantly.", "labels": {"in1": "GSM", "in2": "Ounces per sq yard"}, "factor": 0.02952},
|
||||
{"slug": "gsm-to-ounces-per-sq-yard", "name": "GSM to Ounces per sq yard", "category": "length", "type": "standard", "teaser": "Convert GSM to Ounces per sq yard instantly.", "labels": {"in1": "GSM", "in2": "Ounces per sq yard"}, "factor": 0.02952, "hidden": true},
|
||||
{"slug": "ounces-per-sq-yard-to-gsm", "name": "Ounces per sq yard to GSM", "category": "length", "type": "standard", "teaser": "Convert fabric weight from ounces per square yard into grams per square meter.", "labels": {"in1": "Ounces per sq yard", "in2": "GSM"}, "factor": 33.906074},
|
||||
{"slug": "hands-to-centimeters", "name": "Hands to Centimeters", "category": "length", "type": "standard", "teaser": "Convert Hands to Centimeters instantly.", "labels": {"in1": "Hands", "in2": "Centimeters"}, "factor": 10.16},
|
||||
{"slug": "hands-to-inches", "name": "Hands to Inches", "category": "length", "type": "standard", "teaser": "Convert Hands to Inches instantly.", "labels": {"in1": "Hands", "in2": "Inches"}, "factor": 4.0},
|
||||
{"slug": "hartree-to-electron-volts", "name": "Hartree to Electron-volts", "category": "energy", "type": "standard", "teaser": "Convert Hartree to Electron-volts instantly.", "labels": {"in1": "Hartree", "in2": "Electron-volts"}, "factor": 27.2114},
|
||||
@@ -433,7 +473,7 @@ export const calculators: CalculatorDef[] = [
|
||||
{"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},
|
||||
{"slug": "gradians-to-degrees", "name": "Gradians to Degrees", "category": "angle", "type": "standard", "teaser": "A surveyor logs 100 gradians; what is that angle in degrees?", "labels": {"in1": "Gradians", "in2": "Degrees"}, "factor": 0.9},
|
||||
{"slug": "gradians-to-radians", "name": "Gradians to Radians", "category": "angle", "type": "standard", "teaser": "A control dial sweeps 200 gradians; what is that rotation in radians?", "labels": {"in1": "Gradians", "in2": "Radians"}, "factor": 0.01570796},
|
||||
{"slug": "grains-to-ounces", "name": "Grains to Ounces", "category": "weight", "type": "standard", "teaser": "A jewelry batch weighs 100 grains; how many ounces is that?", "labels": {"in1": "Grains", "in2": "Ounces"}, "factor": 0.002285714},
|
||||
{"slug": "grains-to-ounces", "name": "Grains to Ounces", "category": "weight", "type": "standard", "teaser": "A jewelry batch weighs 100 grains; how many ounces is that?", "labels": {"in1": "Grains", "in2": "Ounces"}, "factor": 0.002285714, "hidden": true},
|
||||
{"slug": "grams-per-cubic-centimeter-to-kilograms-per-liter", "name": "Grams per cubic centimeter to Kilograms per liter", "category": "length", "type": "standard", "teaser": "A fluid density of 1 g/cm\u00b3 equals how many kg/L?", "labels": {"in1": "Grams per cubic centimeter", "in2": "Kilograms per liter"}},
|
||||
{"slug": "grams-per-milliliter-to-kilograms-per-cubic-meter", "name": "Grams per milliliter to Kilograms per cubic meter", "category": "length", "type": "standard", "teaser": "A solution at 1.2 g/mL corresponds to how many kg/m\u00b3?", "labels": {"in1": "Grams per milliliter", "in2": "Kilograms per cubic meter"}, "factor": 1000.0},
|
||||
{"slug": "grams-to-drams", "name": "Grams to Drams", "category": "weight", "type": "standard", "teaser": "A tea blend calls for 2 grams; how many drams should you measure?", "labels": {"in1": "Grams", "in2": "Drams"}, "factor": 0.564383},
|
||||
@@ -465,7 +505,7 @@ export const calculators: CalculatorDef[] = [
|
||||
{"slug": "kpa-to-atmosphere", "name": "kPa to Atmosphere", "category": "pressure", "type": "standard", "teaser": "Convert kilopascals to atmospheres.", "labels": {"in1": "kPa", "in2": "Atmosphere"}, "factor": 0.00986923, "hidden": true},
|
||||
{"slug": "kpa-to-bar", "name": "kPa to Bar", "category": "pressure", "type": "standard", "teaser": "Convert kilopascals to bar.", "labels": {"in1": "kPa", "in2": "Bar"}, "factor": 0.01},
|
||||
{"slug": "kpa-to-pascal", "name": "kPa to Pascal", "category": "pressure", "type": "standard", "teaser": "Convert kilopascals to pascals.", "labels": {"in1": "kPa", "in2": "Pascal"}, "factor": 1000.0},
|
||||
{"slug": "kpa-to-psi", "name": "kPa to PSI", "category": "pressure", "type": "standard", "teaser": "Convert kilopascals to pounds per square inch.", "labels": {"in1": "kPa", "in2": "PSI"}, "factor": 0.1450377377},
|
||||
{"slug": "kpa-to-psi", "name": "kPa to PSI", "category": "pressure", "type": "standard", "teaser": "Convert kilopascals to pounds per square inch.", "labels": {"in1": "kPa", "in2": "PSI"}, "factor": 0.1450377377, "hidden": true},
|
||||
{"slug": "kva-to-kilowatts", "name": "kVA to Kilowatts", "category": "power", "type": "standard", "teaser": "Convert apparent power to real power assuming unity power factor.", "labels": {"in1": "kVA", "in2": "Kilowatts"}},
|
||||
{"slug": "leagues-per-hour-to-kmh", "name": "Leagues per Hour to Kilometers per Hour", "category": "length", "type": "standard", "teaser": "Convert leagues per hour into kilometers per hour.", "labels": {"in1": "Leagues per Hour", "in2": "Kilometers per Hour"}, "factor": 4.82803},
|
||||
{"slug": "leagues-to-kilometers", "name": "Leagues to Kilometers", "category": "length", "type": "standard", "teaser": "Convert leagues to kilometers.", "labels": {"in1": "Leagues", "in2": "Kilometers"}, "factor": 4.82803},
|
||||
@@ -543,7 +583,7 @@ export const calculators: CalculatorDef[] = [
|
||||
{"slug": "kpa-to-atmosphere", "name": "kPa to Atmosphere", "category": "pressure", "type": "standard", "teaser": "Convert kilopascals to atmospheres.", "labels": {"in1": "kPa", "in2": "Atmosphere"}, "factor": 0.00986923, "hidden": true},
|
||||
{"slug": "kpa-to-bar", "name": "kPa to Bar", "category": "pressure", "type": "standard", "teaser": "Convert kilopascals to bar.", "labels": {"in1": "kPa", "in2": "Bar"}, "factor": 0.01},
|
||||
{"slug": "kpa-to-pascal", "name": "kPa to Pascal", "category": "pressure", "type": "standard", "teaser": "Convert kilopascals to pascals.", "labels": {"in1": "kPa", "in2": "Pascal"}, "factor": 1000.0},
|
||||
{"slug": "kpa-to-psi", "name": "kPa to PSI", "category": "pressure", "type": "standard", "teaser": "Convert kilopascals to pounds per square inch.", "labels": {"in1": "kPa", "in2": "PSI"}, "factor": 0.1450377377},
|
||||
{"slug": "kpa-to-psi", "name": "kPa to PSI", "category": "pressure", "type": "standard", "teaser": "Convert kilopascals to pounds per square inch.", "labels": {"in1": "kPa", "in2": "PSI"}, "factor": 0.1450377377, "hidden": true},
|
||||
{"slug": "kva-to-kilowatts", "name": "kVA to Kilowatts", "category": "power", "type": "standard", "teaser": "Convert apparent power to real power assuming unity power factor.", "labels": {"in1": "kVA", "in2": "Kilowatts"}},
|
||||
{"slug": "leagues-per-hour-to-kmh", "name": "Leagues per Hour to Kilometers per Hour", "category": "length", "type": "standard", "teaser": "Convert leagues per hour into kilometers per hour.", "labels": {"in1": "Leagues per Hour", "in2": "Kilometers per Hour"}, "factor": 4.82803},
|
||||
{"slug": "leagues-to-kilometers", "name": "Leagues to Kilometers", "category": "length", "type": "standard", "teaser": "Convert leagues to kilometers.", "labels": {"in1": "Leagues", "in2": "Kilometers"}, "factor": 4.82803},
|
||||
|
||||
@@ -75,7 +75,8 @@ const domainDefinitions: Record<string, { summary: string; context: string }> =
|
||||
},
|
||||
};
|
||||
|
||||
const definitions: Record<string, string> = {};
|
||||
const definitions: Record<string, Record<string, string>> = {};
|
||||
const categoryPriority = [...Object.keys(domainDefinitions)];
|
||||
|
||||
const buildDefinition = (label: string, categoryKey: string): string => {
|
||||
if (!label) return '';
|
||||
@@ -88,14 +89,26 @@ calculators.forEach(calc => {
|
||||
const { category, labels } = calc;
|
||||
Object.values(labels).forEach(label => {
|
||||
if (!label) return;
|
||||
if (!definitions[label]) {
|
||||
definitions[label] = buildDefinition(label, category);
|
||||
}
|
||||
const bucket = definitions[label] || {};
|
||||
const text = buildDefinition(label, category);
|
||||
bucket[category] = text;
|
||||
definitions[label] = bucket;
|
||||
});
|
||||
});
|
||||
|
||||
export function getDefinition(label: string): string | undefined {
|
||||
return definitions[label];
|
||||
const findByPriority = (entries: Record<string, string>, preferred?: string): string | undefined => {
|
||||
if (!entries) return undefined;
|
||||
if (preferred && entries[preferred]) return entries[preferred];
|
||||
for (const category of categoryPriority) {
|
||||
if (entries[category]) return entries[category];
|
||||
}
|
||||
const fallback = Object.values(entries).filter(Boolean);
|
||||
return fallback.length ? fallback[0] : undefined;
|
||||
};
|
||||
|
||||
export function getDefinition(label: string, category?: string): string | undefined {
|
||||
const entries = definitions[label];
|
||||
return findByPriority(entries, category);
|
||||
}
|
||||
|
||||
export const unitDefinitions = definitions;
|
||||
|
||||
Reference in New Issue
Block a user