Is typeof(x::Unitful).parameters[1] reliable?

Is this a reliable (stable) way to extract the type of float of a value of type Unitful, or is this an implementation detail? Is there a standard way to do so?

julia> using Unitful

julia> x = 1.0u"nm"
1.0 nm

julia> typeof(x).parameters[1]
Float64

1 Like

https://painterqubits.github.io/Unitful.jl/stable/manipulations/#Unitful.ustrip

5 Likes