Javascript library for converting quantitative values expressed using UN ECE Recommendation 20 unit codes
https://mgh128.github.io/UnitConverterUNECERec20/
Include the JavaScript file UnitConverterUNECERec20.js from the source folder /src
e.g.
<script src="UnitConverterUNECERec20.js">
Create a new instance of the UnitConverterUNECERec20.js class as follows:
var units=new UnitConverterUNECERec20();
var units=new UnitConverterUNECERec20();
var result=convert({"FAH",212},"CEL");
// convert 212 degrees Fahrenheit to degrees Celsius gives result=100
var units=new UnitConverterUNECERec20();
var relatedUnits=relatedUnits("ATM");
// find related units for "ATM" (atmospheres)
// returns other units of pressure, ["ATM","BAR","HN","J89","MBR","PAL","PS"]
var units=new UnitConverterUNECERec20();
var result=multiconvert({"CEL",100});
// convert 100 degrees Celsius into other temperature units
// result: {"KEL":373.15,"FAH":211.99999999999997,"CEL":100,"A48":671.67}