Say I have 1m
in a text file. I read the text file and put that “1m” into variable x
. How do I parse this x
so that it contains the Unitful.jl
1m
?
julia> x = strip(readstring("a.txt")) # a.txt contains: 1m
"1m"
julia> @u_str("$x")
ERROR: MethodError: no method matching parse(::Expr)