Hi, thank you for your work on Unitful.jl. I was looking for a way to round a Quantity up to a certain resolution, and i discovered there isn't method defined. We can round up to a certain unit, but not a measure. Meaning, we can round a meter up to a cm, but not up to the nearest 5cm measure. May i suggest this:
function round(δ::Quantity, x::Quantity; kwargs...)
if ustrip(δ) == 0
round(unit(δ), x; kwargs...)
else
round(x / δ, RoundNearest; kwargs...) * δ
end
end
julia> round(5u"cm", 1u"m")
100.0 cm
julia> round(5u"cm", 0.94u"m")
95.0 cm
EDIT: this is similar, but different, to #326