Conversions Historical and (2024 Guide) | CalcDomain
Detailed reference converted from the original conversions-historical-and-specialized-units.html page.
Loan Details
Taxes, Insurance & Fees (Optional)
Advanced Settings (Currency & Frequency)
Total Payment (Monthly Equivalent)
$0.00
Principal & Interest
$0.00
Taxes, Ins, HOA
$0.00
Total Interest Cost
$0.00
Payoff
—
| # | Total Payment | Interest | Principal | Extra | Balance |
|---|
Displaying first 360 rows. Download CSV for full data.
How to use
Enter the loan amount, interest rate, and term. Optionally add extra principal and escrow-related costs (taxes, insurance, PMI, HOA). Results update automatically with the Calculate button or inline edits.
Methodology
The calculator uses a fixed-rate amortization model, adding extra principal per period and rolling escrow costs into a monthly-equivalent total payment.
- “Monthly equivalent” keeps different payment frequencies comparable.
- Escrow components convert to a monthly cadence before addition.
- Payoff is shown as number of payments and a rough duration estimate.
Full original guide (expanded)
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9476637732224939"
crossorigin="anonymous"></script>
<header class="bg-white shadow-sm sticky top-0 z-50">
<nav class="container mx-auto px-4 lg:px-6 py-4" aria-label="Primary">
<div class="flex justify-between items-center">
<a
href="https://calcdomain.com"
class="text-2xl font-bold text-blue-600"
>CalcDomain</a
>
<div class="w-full max-w-md hidden md:block mx-8">
<div class="relative">
<input
type="search"
id="search-input"
placeholder="Search for a calculator..."
class="w-full py-2 px-4 pr-10 border border-gray-300 rounded-full focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
autocomplete="off"
/>
<svg
class="w-5 h-5 absolute right-4 top-1/2 -translate-y-1/2 text-gray-400"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
></path>
</svg>
<div
id="search-results"
class="absolute top-full left-0 right-0 bg-white shadow-lg rounded-lg mt-2 max-h-96 overflow-y-auto z-50 hidden border border-gray-200"
></div>
</div>
</div>
<div class="hidden md:flex items-center space-x-6">
<a
href="https://calcdomain.com/search"
class="text-gray-700 hover:text-blue-600 transition-colors"
>Advanced Search</a
>
<a
href="https://calcdomain.com/#categories"
class="text-gray-700 hover:text-blue-600 transition-colors"
>Categories</a
>
</div>
<button
id="mobile-menu-toggle"
class="md:hidden p-2"
aria-controls="mobile-menu"
aria-expanded="false"
aria-label="Open menu"
type="button"
>
<svg
class="w-6 h-6"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 6h16M4 12h16M4 18h16"
></path>
</svg>
</button>
</div>
<nav
id="mobile-menu"
class="md:hidden mt-4 hidden"
aria-label="Mobile menu"
role="navigation"
>
<div class="mb-4">
<div class="relative">
<input
type="search"
id="mobile-search-input"
placeholder="Search calculators..."
class="w-full py-3 px-4 pr-10 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
/>
<svg
class="w-5 h-5 absolute right-4 top-1/2 -translate-y-1/2 text-gray-400"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
></path>
</svg>
</div>
</div>
<div class="space-y-2">
<a
href="https://calcdomain.com/search"
class="block py-2 text-gray-700 hover:text-blue-600"
>Advanced Search</a
>
<a
href="https://calcdomain.com/#categories"
class="block py-2 text-gray-700 hover:text-blue-600"
>Categories</a
>
</div>
</nav>
</nav>
</header>
<div class="container mx-auto px-4 py-8">
<nav id="breadcrumb-container" class="text-sm mb-4 text-gray-600">
<ol class="flex flex-wrap items-center gap-1">
<li><a href="https://calcdomain.com" class="text-blue-600 hover:underline">Home</a></li>
<li class="text-gray-400">/</li>
<li><a href="https://calcdomain.com/categories/math-conversions" class="text-blue-600 hover:underline">Math & Conversion Calculators</a></li>
<li class="text-gray-400">/</li>
<li><a href="https://calcdomain.com/subcategories/math-conversions-measurement-unit-conversions" class="text-blue-600 hover:underline">Measurement Unit Conversions: Tools &</a></li>
<li class="text-gray-400">/</li>
<li><span class="text-gray-800">Historical &amp; Specialized Units Converter</span></li>
</ol>
</nav>
<div class="flex flex-col lg:flex-row gap-8">
<main class="w-full lg:w-2/3">
<div class="bg-white p-6 rounded-lg shadow-md">
<header class="mb-6">
<h1 class="text-2xl md:text-3xl font-bold mb-2">Historical & Specialized Units Converter</h1>
<p class="text-gray-600">A flexible converter for rare, obsolete, archival and “niche” measurement systems. Choose a category (length, mass, volume, typography, maritime/astronomical), pick a unit and we’ll convert it to a modern reference unit and back to another specialized unit.</p>
</header>
<!-- Converter widget -->
<section class="mb-8" aria-label="historical and specialized units converter">
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
<div class="border rounded-lg p-4 bg-gray-50">
<label for="categorySelect" class="block text-sm font-medium text-gray-700 mb-1">Category</label>
<select id="categorySelect" class="w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="historical-length">Historical length</option>
<option value="historical-mass">Historical & trade mass</option>
<option value="historical-volume">Historical volume (imperial & trade)</option>
<option value="typography">Typography & printing</option>
<option value="maritime-astro">Maritime & astronomical</option>
</select>
<p class="field-hint mt-2">Values are best-effort, widely cited references.</p>
</div>
<div class="border rounded-lg p-4 bg-gray-50">
<label for="fromUnit" class="block text-sm font-medium text-gray-700 mb-1">From unit</label>
<select id="fromUnit" class="w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"></select>
<input type="number" id="fromValue" step="any"
class="mt-2 w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="Enter value" inputmode="decimal" />
</div>
<div class="border rounded-lg p-4 bg-gray-50">
<label for="toUnit" class="block text-sm font-medium text-gray-700 mb-1">To unit</label>
<select id="toUnit" class="w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"></select>
<input type="text" id="toValue" readonly
class="mt-2 w-full border border-gray-300 rounded-md px-3 py-2 bg-white"
aria-readonly="true" />
<p class="field-hint mt-2">Conversion done via the category’s base unit (m, kg, L, mm or m).</p>
</div>
</div>
<p class="text-xs text-gray-500">Tip: to compare two strange units (e.g. Roman mile → league), choose the same category, set “from” to Roman mile, “to” to league.</p>
</section>
<!-- Formula -->
<section class="mb-8">
<h2 class="text-xl font-semibold mb-2">How we convert</h2>
<div class="formula-box">
<p class="text-sm font-mono mb-2">to_value = from_value × (from_factor_to_base ÷ to_factor_to_base)</p>
<p class="text-sm mb-2">Example (Historical length): 1 Roman mile (1479 m) → league (4828.032 m)</p>
<p class="text-sm font-mono">value_in_league = 1 × (1479 ÷ 4828.032) ≈ 0.3065 league</p>
</div>
<p class="text-sm text-gray-600">Each category has its own base: meters, kilograms, liters, millimeters, or meters again (for maritime/astronomical). We state typical values but museums, navies and national standards may differ.</p>
</section>
<!-- Reference tables -->
<section class="mb-8">
<h2 class="text-xl font-semibold mb-3">Reference values used here</h2>
<div class="overflow-x-auto mb-4">
<table class="convert-table" aria-label="historical length reference values">
<thead>
<tr>
<th colspan="2">Historical length (base: meter)</th>
</tr>
<tr>
<th>Unit</th>
<th>To meter</th>
</tr>
</thead>
<tbody>
<tr><td>Egyptian royal cubit</td><td>0.5235 m</td></tr>
<tr><td>Biblical cubit (~18 in)</td><td>0.4572 m</td></tr>
<tr><td>Roman foot</td><td>0.296 m</td></tr>
<tr><td>Roman mile</td><td>1479 m</td></tr>
<tr><td>League (land)</td><td>4828.032 m</td></tr>
</tbody>
</table>
</div>
<div class="overflow-x-auto mb-4">
<table class="convert-table" aria-label="historical mass reference values">
<thead>
<tr>
<th colspan="2">Historical & trade mass (base: kilogram)</th>
</tr>
<tr>
<th>Unit</th>
<th>To kilogram</th>
</tr>
</thead>
<tbody>
<tr><td>Stone (UK)</td><td>6.35029318 kg</td></tr>
<tr><td>Troy ounce</td><td>0.0311034768 kg</td></tr>
<tr><td>Tola (India)</td><td>0.0116638 kg</td></tr>
<tr><td>Catty (China)</td><td>0.60478982 kg</td></tr>
<tr><td>Scruple (apothecary)</td><td>0.0012959782 kg</td></tr>
</tbody>
</table>
</div>
<div class="overflow-x-auto mb-4">
<table class="convert-table" aria-label="historical volume reference values">
<thead>
<tr>
<th colspan="2">Historical / trade volume (base: liter)</th>
</tr>
<tr>
<th>Unit</th>
<th>To liter</th>
</tr>
</thead>
<tbody>
<tr><td>US gill</td><td>0.118294118 L</td></tr>
<tr><td>UK gill</td><td>0.1420653125 L</td></tr>
<tr><td>Oil barrel (US)</td><td>158.9872949 L</td></tr>
<tr><td>Hogshead (US wine)</td><td>238.4809424 L</td></tr>
<tr><td>US dry bushel</td><td>35.23907017 L</td></tr>
</tbody>
</table>
</div>
<div class="overflow-x-auto mb-4">
<table class="convert-table" aria-label="typography reference values">
<thead>
<tr>
<th colspan="2">Typography & printing (base: mm)</th>
</tr>
<tr>
<th>Unit</th>
<th>To mm</th>
</tr>
</thead>
<tbody>
<tr><td>PostScript point (1/72 in)</td><td>0.352777778 mm</td></tr>
<tr><td>PostScript pica (12 pt)</td><td>4.233333333 mm</td></tr>
<tr><td>Didot point</td><td>0.375 mm</td></tr>
</tbody>
</table>
</div>
<div class="overflow-x-auto">
<table class="convert-table" aria-label="maritime and astronomical reference values">
<thead>
<tr>
<th colspan="2">Maritime & astronomical (base: meter)</th>
</tr>
<tr>
<th>Unit</th>
<th>To meter</th>
</tr>
</thead>
<tbody>
<tr><td>Nautical mile</td><td>1852 m</td></tr>
<tr><td>Fathom</td><td>1.8288 m</td></tr>
<tr><td>Astronomical unit (exact)</td><td>149,597,870,700 m</td></tr>
</tbody>
</table>
</div>
</section>
<!-- E-E-A-T content -->
<section class="prose">
<h2>About historical units</h2>
<p>Before SI and national standards, units were pragmatic: the length of an arm, the capacity of a barrel, the yield of a field. That means: the same name, different places, different values. We picked commonly cited modern reference approximations (museums, NIST tables, well-known engineering handbooks).</p>
<h3>How to use this tool safely</h3>
<ul>
<li>Always note the source (city, period) if you are doing academic work.</li>
<li>For maritime or aviation use, rely on current national/ICAO/IMO definitions.</li>
<li>For book & type history, double check with the printing specification of the era.</li>
</ul>
<h2>FAQ</h2>
<h3>1. Can I convert, say, a tola to a hogshead?</h3>
<p>They’re different dimensions (mass vs volume), so the tool won’t mix those. Pick a category where units share a base dimension.</p>
<h3>2. Why isn’t my local historical unit here?</h3>
<p>There are hundreds. We included a solid core to cover many research and hobby cases. You can simulate yours by using a nearby unit and scaling the input value.</p>
<h3>3. Do you support SI directly?</h3>
<p>Yes — in each category there’s a modern “base” unit (meter, kg, liter, mm). Convert historical → base → export to another system.</p>
</section>
</div>
<section class="mt-10" id="author">
<h2 class="text-xl font-semibold mb-4">About the author</h2>
<div class="bg-gray-50 border border-gray-200 rounded-lg p-4">
<p class="text-sm text-gray-700">
<a href="https://www.linkedin.com/in/ugocandido92821/" class="text-blue-600 hover:underline" target="_blank" rel="noopener">Ugo Candido</a>
builds financial tools and educational resources to help
readers make better money decisions. He focuses on practical,
transparent models that reflect how lenders calculate
payments and total cost of ownership.
</p>
<p class="text-sm text-gray-700 mt-3">
Contact: <a href="mailto:info@calcdomain.com" class="text-blue-600 hover:underline">info@calcdomain.com</a>
</p>
</div>
</section>
<section class="mt-10" id="editorial-policy">
<h2 class="text-xl font-semibold mb-4">Editorial policy</h2>
<div class="bg-gray-50 border border-gray-200 rounded-lg p-4">
<p class="text-sm text-gray-700">
CalcDomain content is created for educational purposes and is
reviewed for clarity, accuracy, and transparency. We do not
accept paid placements that influence calculator outputs.
Inputs and assumptions are shown directly in the interface so
you can verify how results are produced.
</p>
</div>
</section>
<section class="mt-10" id="methodology">
<h2 class="text-xl font-semibold mb-4">Methodology</h2>
<div class="bg-gray-50 border border-gray-200 rounded-lg p-4">
<p class="text-sm text-gray-700">
Results use standard formulas and the values you provide.
Figures are estimates and may differ from lender quotes.
For decisions that require professional guidance, consult a
licensed advisor.
</p>
</div>
</section>
<section class="mt-10" id="sources">
<h2 class="text-xl font-semibold mb-4">Sources</h2>
<div class="bg-gray-50 border border-gray-200 rounded-lg p-4">
<ul class="list-disc list-inside text-sm text-gray-700 space-y-1">
<li>
<a href="https://www.nist.gov/pml/owm/metric-si/si-units" class="text-blue-600 hover:underline" target="_blank" rel="noopener">
NIST: The International System of Units (SI)
</a>
</li>
<li>
<a href="https://openstax.org/details/books/college-algebra" class="text-blue-600 hover:underline" target="_blank" rel="noopener">
OpenStax: College Algebra
</a>
</li>
</ul>
</div>
</section>
<section class="bg-white p-4 rounded-lg shadow-md mt-6"><h2 class="text-lg font-semibold mb-2">Engineering notes</h2><p class="text-sm text-gray-700">Use SI units and keep dimensional consistency. Verify boundary conditions, safety factors, and design limits.</p><p class="text-sm text-gray-700 mt-2">Key entities: Conversions, Historical, And, Specialized, Units, Category, From unit, To unit.</p></section><section class="bg-white p-4 rounded-lg shadow-md mt-6"><h2 class="text-lg font-semibold mb-2">Inputs used by this calculator</h2><ul class="text-sm text-gray-700 list-disc pl-5"><li>Category</li><li>From unit</li><li>To unit</li></ul></section><section class="bg-white p-4 rounded-lg shadow-md mt-6"><h2 class="text-lg font-semibold mb-2">Consistency checks</h2><p class="text-sm text-gray-700">Checks: consistent units, allowed ranges, technical rounding.</p></section><section class="bg-white p-4 rounded-lg shadow-md mt-6"><h2 class="text-lg font-semibold mb-2">Engineering notes</h2><p class="text-sm text-gray-700">Use SI units and keep dimensional consistency. Verify boundary conditions, safety factors, and design limits.</p><p class="text-sm text-gray-700 mt-2">Key entities: Conversions, Historical, And, Specialized, Units, Category, From unit, To unit.</p></section><section class="bg-white p-4 rounded-lg shadow-md mt-6"><h2 class="text-lg font-semibold mb-2">Inputs used by this calculator</h2><ul class="text-sm text-gray-700 list-disc pl-5"><li>Category</li><li>From unit</li><li>To unit</li></ul></section><section class="bg-white p-4 rounded-lg shadow-md mt-6"><h2 class="text-lg font-semibold mb-2">Consistency checks</h2><p class="text-sm text-gray-700">Checks: consistent units, allowed ranges, technical rounding.</p></section><!-- %%EEAT_STRIP%% -->
<!-- %%QUALITY_BLOCKS%% -->
<!-- %%FAQ_JSONLD%% -->
</main>
<aside class="w-full lg:w-1/3">
<div class="bg-white p-5 rounded-lg shadow-md mb-6">
<h2 class="text-lg font-semibold mb-3">Related converters</h2>
<ul class="space-y-2">
<li><a href="https://calcdomain.com/subcategories/math-conversions-measurement-unit-conversions" class="text-blue-600 hover:underline">All Measurement Conversions</a></li>
<li><a href="https://calcdomain.com/bushels-to-liters" class="text-blue-600 hover:underline">Bushels to Liters</a></li>
<li><a href="https://calcdomain.com/troy-ounces-to-grams" class="text-blue-600 hover:underline">Troy Ounces to Grams</a></li>
<li><a href="https://calcdomain.com/light-years-to-miles" class="text-blue-600 hover:underline">Light-years to Miles</a></li>
<li><a href="https://calcdomain.com/food-density" class="text-blue-600 hover:underline">Food Density</a></li>
<li><a href="https://calcdomain.com/levenes-test" class="text-blue-600 hover:underline">Levene’s Test for Homogeneity of Variances</a></li>
</ul>
</div>
<div class="bg-white p-5 rounded-lg shadow-md">
<h2 class="text-lg font-semibold mb-3">Sources & caution</h2>
<p class="text-sm text-gray-600 mb-2">✔ Values inspired by NIST, classic engineering tables, maritime references.</p>
<p class="text-sm text-gray-600 mb-2">✔ For legal metrology, use your country’s up-to-date tables.</p>
<p class="text-sm text-gray-600">✔ Historical research? Document the value you used.</p>
</div>
</aside>
</div>
</div>
<footer class="bg-gray-900 text-white py-12">
<div class="container mx-auto px-4">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
<div>
<h3 class="text-2xl font-bold mb-4">CalcDomain</h3>
<p class="text-gray-400 mb-4">Your trusted source for free online calculators. Accurate, fast, and reliable calculations for every need.</p>
</div>
<div>
<h4 class="text-lg font-semibold mb-4">Categories</h4>
<ul class="space-y-2">
<li><a href="https://calcdomain.com/finance" class="text-gray-400 hover:text-white">Finance</a></li>
<li><a href="https://calcdomain.com/health-fitness" class="text-gray-400 hover:text-white">Health & Fitness</a></li>
<li><a href="https://calcdomain.com/math-conversions" class="text-gray-400 hover:text-white">Math & Conversions</a></li>
<li><a href="https://calcdomain.com/lifestyle-everyday" class="text-gray-400 hover:text-white">Lifestyle & Everyday</a></li>
<li><a href="https://calcdomain.com/construction-diy" class="text-gray-400 hover:text-white">Construction & DIY</a></li>
</ul>
</div>
<div>
<h4 class="text-lg font-semibold mb-4">Popular Tools</h4>
<ul class="space-y-2">
<li><a href="https://calcdomain.com/mortgage-payment" class="text-gray-400 hover:text-white">Mortgage Calculator</a></li>
<li><a href="https://calcdomain.com/percentage-calculator" class="text-gray-400 hover:text-white">Percentage Calculator</a></li>
<li><a href="https://calcdomain.com/bmi-calculator" class="text-gray-400 hover:text-white">BMI Calculator</a></li>
<li><a href="https://calcdomain.com/auto-loan-calculator" class="text-gray-400 hover:text-white">Auto Loan Calculator</a></li>
<li><a href="https://calcdomain.com/house-affordability" class="text-gray-400 hover:text-white">House Affordability</a></li>
</ul>
</div>
<div>
<h4 class="text-lg font-semibold mb-4">Support</h4>
<ul class="space-y-2">
<li><a href="https://calcdomain.com/about" class="text-gray-400 hover:text-white">About Us</a></li>
<li><a href="https://calcdomain.com/contact" class="text-gray-400 hover:text-white">Contact</a></li>
<li><a href="https://calcdomain.com/privacy" class="text-gray-400 hover:text-white">Privacy Policy</a></li>
<li><a href="https://calcdomain.com/terms" class="text-gray-400 hover:text-white">Terms of Service</a></li>
<li><a href="https://calcdomain.com/sitemap.xml" class="text-gray-400 hover:text-white">Site Map</a></li>
</ul>
</div>
</div>
<div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-400">
<p>© 2025 CalcDomain. All Rights Reserved. | Free Online Calculators for Everyone</p>
</div>
</div>
</footer>
<script src="/assets/js/mobile-menu.js"></script>
<script src="/search.js"></script>
<script>
(function() {
// category definitions
const categories = {
"historical-length": {
base: "m",
units: [
{ id: "m", name: "Meter (modern SI)", factor: 1 },
{ id: "egyptian_cubit", name: "Egyptian royal cubit (0.5235 m)", factor: 0.5235 },
{ id: "biblical_cubit", name: "Biblical cubit (~0.4572 m)", factor: 0.4572 },
{ id: "roman_foot", name: "Roman foot (0.296 m)", factor: 0.296 },
{ id: "roman_mile", name: "Roman mile (1479 m)", factor: 1479 },
{ id: "league_land", name: "League (land) 3 mi (4828.032 m)", factor: 4828.032 }
]
},
"historical-mass": {
base: "kg",
units: [
{ id: "kg", name: "Kilogram (SI)", factor: 1 },
{ id: "stone_uk", name: "Stone (UK) (6.35029318 kg)", factor: 6.35029318 },
{ id: "troy_oz", name: "Troy ounce (0.0311034768 kg)", factor: 0.0311034768 },
{ id: "tola", name: "Tola (0.0116638 kg)", factor: 0.0116638 },
{ id: "catty", name: "Catty / Jin (0.60478982 kg)", factor: 0.60478982 },
{ id: "scruple", name: "Scruple (apothecary) (0.0012959782 kg)", factor: 0.0012959782 }
]
},
"historical-volume": {
base: "L",
units: [
{ id: "liter", name: "Liter (L)", factor: 1 },
{ id: "us_gill", name: "US gill (0.118294118 L)", factor: 0.118294118 },
{ id: "uk_gill", name: "UK gill (0.1420653125 L)", factor: 0.1420653125 },
{ id: "us_oil_barrel", name: "US oil barrel (158.9872949 L)", factor: 158.9872949 },
{ id: "us_hogshead", name: "US hogshead (238.4809424 L)", factor: 238.4809424 },
{ id: "us_dry_bushel", name: "US dry bushel (35.23907017 L)", factor: 35.23907017 }
]
},
"typography": {
base: "mm",
units: [
{ id: "mm", name: "Millimeter (mm)", factor: 1 },
{ id: "ps_point", name: "PostScript point (0.352777778 mm)", factor: 0.352777778 },
{ id: "ps_pica", name: "PostScript pica (4.233333333 mm)", factor: 4.233333333 },
{ id: "didot_point", name: "Didot point (0.375 mm)", factor: 0.375 }
]
},
"maritime-astro": {
base: "m",
units: [
{ id: "m", name: "Meter (SI)", factor: 1 },
{ id: "nautical_mile", name: "Nautical mile (1852 m)", factor: 1852 },
{ id: "fathom", name: "Fathom (1.8288 m)", factor: 1.8288 },
{ id: "au", name: "Astronomical unit (149,597,870,700 m)", factor: 149597870700 }
]
}
};
const categorySelect = document.getElementById('categorySelect');
const fromUnit = document.getElementById('fromUnit');
const toUnit = document.getElementById('toUnit');
const fromValue = document.getElementById('fromValue');
const toValue = document.getElementById('toValue');
function populateUnits(catKey) {
const cat = categories[catKey];
fromUnit.innerHTML = '';
toUnit.innerHTML = '';
cat.units.forEach(u => {
const opt1 = document.createElement('option');
opt1.value = u.id;
opt1.textContent = u.name;
fromUnit.appendChild(opt1);
const opt2 = document.createElement('option');
opt2.value = u.id;
opt2.textContent = u.name;
toUnit.appendChild(opt2);
});
// set default: from first, to second if available
if (toUnit.options.length > 1) {
toUnit.selectedIndex = 1;
}
}
function convert() {
const catKey = categorySelect.value;
const cat = categories[catKey];
const val = parseFloat(fromValue.value);
if (isNaN(val)) {
toValue.value = '';
return;
}
const fromDef = cat.units.find(u => u.id === fromUnit.value);
const toDef = cat.units.find(u => u.id === toUnit.value);
if (!fromDef || !toDef) {
toValue.value = '';
return;
}
// go to base
const inBase = val * fromDef.factor;
// to target
const result = inBase / toDef.factor;
// format
let out = result;
if (result > 1e9 || result < 1e-3) {
out = result.toExponential(6);
} else {
out = Math.round(result * 1000000) / 1000000;
}
toValue.value = out;
}
categorySelect.addEventListener('change', () => {
populateUnits(categorySelect.value);
convert();
});
fromUnit.addEventListener('change', convert);
toUnit.addEventListener('change', convert);
fromValue.addEventListener('input', convert);
// init
populateUnits(categorySelect.value);
fromValue.value = 1;
convert();
})();
</script>
<script>
window.MathJax = {
tex: { inlineMath: [['\\(','\\)'], ['$', '$']], displayMath: [['$','$'], ['\\[','\\]']] },
svg: { fontCache: 'global' }
};
</script>
<script>
(function () {
var loadMathJax = function () {
if (window.__mathjaxLoading) return;
window.__mathjaxLoading = true;
var script = document.createElement("script");
script.id = "MathJax-script";
script.async = true;
script.src = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js";
document.head.appendChild(script);
};
var target = document.querySelector(
".formula-box, .mathjax, .math, .formula, [data-mathjax]"
);
if (!target) return;
if ("IntersectionObserver" in window) {
var observer = new IntersectionObserver(
function (entries) {
if (entries.some(function (entry) { return entry.isIntersecting; })) {
observer.disconnect();
loadMathJax();
}
},
{ rootMargin: "200px" }
);
observer.observe(target);
} else {
window.addEventListener(
"load",
function () {
setTimeout(loadMathJax, 1000);
},
{ once: true }
);
}
})();
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-7MB5V1LZRN"></script>
<script>
window.__cmpLoadQueued = window.__cmpLoadQueued || [];
window.addEventListener("load", function () {
var loadCmp = function () {
var s1 = document.createElement("script");
s1.src = "https://cmp.gatekeeperconsent.com/min.js";
s1.async = true;
s1.setAttribute("data-cfasync", "false");
document.head.appendChild(s1);
var s2 = document.createElement("script");
s2.src = "https://the.gatekeeperconsent.com/cmp.min.js";
s2.async = true;
s2.setAttribute("data-cfasync", "false");
document.head.appendChild(s2);
};
if ("requestIdleCallback" in window) {
requestIdleCallback(loadCmp, { timeout: 2000 });
} else {
setTimeout(loadCmp, 1000);
}
});
</script>
<script async src="//www.ezojs.com/ezoic/sa.min.js"></script>
<script>
window.ezstandalone = window.ezstandalone || {};
ezstandalone.cmd = ezstandalone.cmd || [];
</script>