Skip to content
Shadow Man edited this page Aug 21, 2013 · 10 revisions

Build Status

Why fork js-quantities?

This fork of gentoobootoo's wonderful js-quantities library was originally created to fix a bug in temperature conversion. The bug fixes from this fork have since been merged into gentooboontoo's repo. It is staying around for use as a test bed and for possible future improvements such as those listed below.

We chose his library due to its similarity with the Java jsr-275 unit library and how full featured it appeared to be.

If you want to use js-quantities (and who could blame you, it is a very powerful conversion library), please use or fork gentooboontoo's version instead: https://github.com/gentooboontoo/js-quantities

Possible future improvements:

  1. Update the constructor such that new Qty("100 degC*.1") works the same as new Qty("100 degC").mul(0.1) to create a quantity in units of tenths of a degree celsius.
  2. Add "best_prefix" support. See: https://github.com/olbrich/ruby-units/issues/4
  3. Have mul/div of non-unitless quantities (including inverse and possibly constructor) check num/den (numerator/denominator) to use base units found with scalar 1.0 and identical num/den, so "1/ohm" would be replaced with "S" (as their expanded num/den are identical.
Clone this wiki locally