We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@u_str
I would like to pass a string to @u_str to create a unit, but it doesn't work:
julia> a = "km" "km" julia> @u_str(a) ERROR: LoadError: MethodError: no method matching parse(::Symbol) Closest candidates are: parse(::AbstractString; filename, raise, depwarn) @ Base meta.jl:276 parse(::AbstractString, ::Integer; filename, greedy, raise, depwarn) @ Base meta.jl:236 Stacktrace: [1] var"@u_str"(__source__::LineNumberNode, __module__::Module, unit::Any) @ Unitful ~/.julia/packages/Unitful/R4J37/src/user.jl:630 in expression starting at REPL[100]:1
I'm parsing a json file which contains values and a string representation of their units, so I can't just pass a string literal.
The text was updated successfully, but these errors were encountered:
Nevermind, I just found the undocumented uparse, which serves my purpose.
uparse
julia> a = "km" "km" julia> Unitful.uparse(a) km
Sorry, something went wrong.
No branches or pull requests
I would like to pass a string to
@u_str
to create a unit, but it doesn't work:I'm parsing a json file which contains values and a string representation of their units, so I can't just pass a string literal.
The text was updated successfully, but these errors were encountered: