I apologize if this has been answered before, I couldn't find it so far.
So how can Float64 be converted into ASCIIString?
My attempts
julia> parse(5.0)
ERROR: `parse` has no method matching parse(::Float64)
julia> convert(ASCIIString, 5.0)
ERROR: `convert` has no method matching convert(::Type{ASCIIString}, ::Float64)
in convert at base.jl:13
julia> parsefloat(5.0)
ERROR: `parsefloat` has no method matching parsefloat(::Float64)
Julia version 0.3.7
Use the string function:
julia> string(0.5)
"0.5"
EDIT:
For custom formatted strings, you can use the @sprintf macro:
julia> @sprintf("%.2f",0.5)
"0.50"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With