gentooboontoo / js-quantities

JavaScript library for quantity calculation and unit conversion
http://gentooboontoo.github.io/js-quantities/
MIT License
396 stars 102 forks source link

Add new two-argument signature #54

Closed mickeyreiss closed 8 years ago

mickeyreiss commented 8 years ago

I have a use-case where my units and scalars are each available programmatically. This patch adds a convenience constructor to support this usage:

// New signature
new Qty(10, "m");
// which is equivalent to
new Qty("10 m"); 

:octocat:

gentooboontoo commented 8 years ago

Merged. Thank you.