You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no easy way built into this package, but you could use the following function to extract the individual units of a Units object into a Tuple:
functionunit_tuple(u::Unitful.Units{N}) where N
length(N) ==1? (Unitful.FreeUnits(u),) :map(x -> Unitful.FreeUnits{(x,),dimension(x),nothing}(), N)
end
The branch for length(N) == 1 is only necessary for affine units (without it, unittuple(°C) would return K).
If I have a unit that I know is energy/length^3 is there a way I can pull out the unit for energy and the unit for length separately?
Thanks!
The text was updated successfully, but these errors were encountered: