Julien Sanchez
Julien Sanchez
No, there's not (publicly at least). It really seems to be a bug. Units are meant to be automatically simplified. ``` javascript Qty('3 lbs').div(Qty('2 kg')).toString(); // -> "0.68..." as intended...
It is not currently possible. I think implementing a method like `toPrefix` could fill the gap. For instance, `someqty.toPrefix('c')` would return converted quantity using centi as prefix. When calling `toPrefix`...
I disagree about the fix made in ruby-units (removal of `pt` as abbreviation of `point`). `pt` is commonly used with font sizes and CSS. I would like to keep the...
It would be an interesting feature to implement. I would like it leverages extensibility through formatters (https://github.com/gentooboontoo/js-quantities#formatting-quantities). ``` javascript var engFormatter = function(scalar, units) { /*...*/ }; // ... qty.format(engFormatter);...
Hi @EntilZha, Thank you very much for your PR. Before you open this issue, I have already made an experimental branch (qty-formatter) allowing custom formatting of quantities by defining a...
This error is expected. `mmol/l` and `mg/dl` are not dimensionally compatible (the kind of the former is a molar concentration and the latter is density), so they cannot be converted...
Yes it should work as js-quantities handles units multiplication and division (but it seems to be a small rounding error here, I will try to track it down).
I am open to any suggestion or help about concrete implementation. To me, the best representation of a quantity is its plain string form (as output by `Qty#toString()`). In this...
It is not currently possible. Long names of units are only used for parsing, not for formatting. Could you give me an example of how you would like to use...
Not directly related to your issue and just for info, I have begun to externalize formatting from Qty instances to allow client code to customize formatting. Please check out qty-formatter...