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
julia>round(1.2u"s")
ERROR: specify the type of the quantity to convert to when rounding quantities. Example:round(typeof(1u"m"), 137u"cm").
Stacktrace:⋮ internal @ Base, Unitful
[3] round(x::Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}, r::RoundingMode{:Nearest}; kwargs::@Kwargs{})
@ Unitful ~/.julia/packages/Unitful/6r8Hq/src/quantities.jl:327
Use `err` to retrieve the full stack trace.
julia>let x =1.2u"s"; round(typeof(x), x; digits=2) end1.2 s
What about defining round(x::Quantity; kw...) = round(typeof(x), x; kw...) so I don't have to pass it myself? Would that work?
The text was updated successfully, but these errors were encountered:
What about defining
round(x::Quantity; kw...) = round(typeof(x), x; kw...)
so I don't have to pass it myself? Would that work?The text was updated successfully, but these errors were encountered: