# Unit Converter

The converter references the existing sxript runtime from `../sxript/src/sxript.js` and reuses the safe expression parser and runtime setup in `../calculator/engine.mjs`. The core is not copied into this project. Conversion factors and offsets in `units.js` are sxript expressions; the converter evaluates `(input + offset) × scale` in sxript to reach a category's canonical unit. Conversion arithmetic, temperature bounds, and display rounding run in sxript. Displayed results use up to 12 significant digits; swapping uses the unrounded result.

Open `index.html` through the website or local HTTP server, rather than a `file:` address, so module workers can load. Conversion runs locally in the browser and does not send values to an external service. The page starts with an empty input and keeps no persistent state.

Definitions follow these primary references:

- [NIST SP 811, Appendix B.9: conversion factors by quantity](https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors/nist-guide-si-appendix-b9)
- [NIST SP 811, Appendix B: international foot and derived factors](https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors)
- [NIST SP 811 footnotes: exact pound, pound-force, cubic inch, and International Table Btu](https://www.nist.gov/pml/special-publication-811/nist-guide-si-footnotes)
- [NIST Handbook 44, Appendix C: U.S. customary liquid measures](https://www.nist.gov/system/files/documents/2023/01/30/appc-23-HB44.pdf)
- [NIST SI binary prefixes](https://physics.nist.gov/cuu/Units/binary.html)
- [NIST CODATA: electronvolt](https://physics.nist.gov/cgi-bin/cuu/Value?evj)

Derived factors retain their defining products, quotients, and powers rather than rounded lookup factors. Inch/foot/mile use international definitions. Mass uses the avoirdupois pound; short tons, long tons, and tonnes are distinct. U.S. volume units are liquid measures; the customary cup is half a U.S. liquid pint. The Imperial gallon is 4.54609 liters. Celsius and Fahrenheit are absolute temperature scales here, not temperature intervals. Time covers fixed durations, not calendar months or years. Decimal data prefixes are powers of 1000 and IEC prefixes are powers of 1024; a byte is eight bits.
