Unitful.jl Molarity Calculation Question

I think there is nothing wrong, but that the capacity of simplifying units automatically of the package is somewhat limited (also because it is hard to say what the user wants). For instance:

julia> 1u"mol/L" * 20u"L"
20 mol

julia> 1u"M" * 20u"L"
20 L M

julia> 1u"N" * 1u"m"
1 m N

julia> uconvert(u"J", 1u"m*N")
1 J

These are two similar situations where we could expect simpler units to be displayed. But is that what the user wants? Sometimes yes, but hard to say.

At least we can use explicit checks with the units:

julia> 1u"J" == 1u"N*m"
true

julia> 1u"M*L" == 1u"mol"
true
1 Like