-
Couldn't load subscription status.
- Fork 8
Open
Description
It would be nice if this worked natively. Probably not too difficult to implement, but I'm not sure how package extensions work.
julia> using Format, Unitful
julia> x = 12345.6u"lbf"
12345.6 lbf
julia> format(x, commas=true, precision=0)
ERROR: MethodError: no method matching format(::Quantity{Float64, π π π^-2, Unitful.FreeUnits{(lbf,), π π π^-2, nothing}}; commas::Bool, precision::Int64)
The function `format` exists, but no method is defined for this combination of argument types.Workaround:
julia> format(ustrip(x), commas=true, precision=0, suffix=" $(string(unit(x)))")
"12,346 lbf"Metadata
Metadata
Assignees
Labels
No labels