Search code examples
mathphysicsjavascriptunit-conversion

Javascript: unit of measure conversion library?


Is there are reputable and comprehensive unit conversion Javascript library? I do not want any libraries that makes AJAX calls to WolframAlpha or Google but something that does the calculation locally.


Solution

  • The math.js library comes with support for units. The library does not yet support derived units but that is on the planning.

    http://mathjs.org/

    Example usage:

    math.evaluate('2 inch in cm');
    math.evaluate('0.5kg + 33g');
    math.evaluate('cos(45 deg)');