ruby-units icon indicating copy to clipboard operation
ruby-units copied to clipboard

best_prefix produces invalid results

Open Jubke opened this issue 7 years ago • 1 comments

I stumbled upon the 'best_prefix' method when I was looking for something along the lines of #4. Trying to use it, though, I noticed it doesn't work for mass units:

t = Unit.new("2000 kg").best_prefix
=> 2 kkg 

and

t = Unit.new("23000 mg").best_prefix
=> 23000 mg

I'm guessing has something to do with kg being SI base unit instead of g?!

Jubke avatar Jul 27 '18 11:07 Jubke

Thanks, I'll look into it.

olbrich avatar Jul 27 '18 12:07 olbrich