js-quantities icon indicating copy to clipboard operation
js-quantities copied to clipboard

JavaScript library for quantity calculation and unit conversion

Results 59 js-quantities issues
Sort by recently updated
recently updated
newest added

I have a value of `1200000 mm' and I wan't to have a method which automatically transfers to the best prefix like: const qty = new Qty(1200000, 'mm').toBest() // now...

Hi, I just started to work with [js-quantities](https://github.com/gentooboontoo/js-quantities) and haven't figured out how to get error messages. If something goes wrong (e.g. when `Qty('1 Amporia')` was entered), only the message...

I'm trying to use js-quantities to parse input for an engineering simulation. I want users to enter input in any units by writing both the unit value and name. Ex,...

This may not be necessary, but it would be nice to have a feature that could normalize labels to powers of 10^(3*n) given the prominence of engineering notation. Example: `Qty('.0001...

enhancement

This may be easy, but I haven't quite teased out if this is possible yet. Goal: I have data that comes in various magnitudes and I would like to normalize...

enhancement

mmol/l = mg/dl / 18 mg/dl = 18 × mmol/l Trying to make a medical calculator with js-quantities. But can't seem to convert between the two frequently used units to...

In electronic engineering 1Mohm is typically 1000,000 Ohm. ``` > Qty = require('js-quantities') > k = Qty('1kohm') Qty { scalar: 1, baseScalar: 1000, signature: -312058, _conversionCache: {}, numerator: [ '',...

I have a lot of data coming in formatted as `'fl oz'`, but it's not supported with the space so I have to do some custom parsing before handing it...

In the source, [there's a comment about parsing USA/Imperial style values, like `8lbs 6oz` or `6'4"`](https://github.com/gentooboontoo/js-quantities/blob/master/src/quantities.js#L666-L667) However, if we try `new Qty('6\' 6"')`, it fails with the error`QtyError {name: "QtyError",...

1 US Gallons = 0.832674 Imperial Gallons