Unitful.jl
Unitful.jl copied to clipboard
Converting inverse units fails
julia> uconvert(u"1/km", 3.0u"1/m")
ERROR: MethodError: no method matching uconvert(::Quantity{Int64, π^-1, Unitful.FreeUnits{(km^-1,), π^-1, nothing}}, ::Quantity{Float64, π^-1, Unitful.FreeUnits{(m^-1,), π^-1, nothing}})
Is this supposed to work? Why not?
This doesnβt work because u"1/km" is a quantity, not a unit. You can use u"km^-1" instead.
Thanks.
An error-message hint (Base.Experimental.register_error_hint) might be helpful here.