protometa/convert-metric

Precision output bug

Closed this issue · 0 comments

.toPrecision() will convert to exponential notation when decreasing precision of a large integer part. This exponential notion is not compatible with the subsequent trimming operation and it only outputs the exponent.

convert('12000 lb', 3) // returns "3 kg", expected "5440 kg"