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
tryparse
Code to test, using Julia 1.6.6 and FixedPointDecimals 0.4.0:
julia> using FixedPointDecimals julia> tryparse(FixedDecimal{Int64,2},"1.5") ERROR: MethodError: no method matching tryparse(::Type{FixedDecimal{Int64, 2}}, ::String) Closest candidates are: tryparse(::Type{Complex{S}}, ::AbstractString) where S<:Real at parse.jl:384 tryparse(::Type{T}, ::AbstractString) where T<:Dates.TimeType at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Dates/src/parse.jl:288 tryparse(::Type{T}, ::AbstractString, ::Dates.DateFormat) where T<:Dates.TimeType at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Dates/src/parse.jl:288 ... Stacktrace: [1] top-level scope @ REPL[2]:1 julia>
It might be useful to look at the base implementation of parse to fix this
parse
The text was updated successfully, but these errors were encountered:
A naive fix might be to implement something like this:
function Base.tryparse(::Type{FD}, args...; kwargs...) where FD <: FixedDecimal try return parse(FD,args...;kwargs...) catch return nothing end end
Sorry, something went wrong.
Fixed by #80
No branches or pull requests
Code to test, using Julia 1.6.6 and FixedPointDecimals 0.4.0:
It might be useful to look at the base implementation of
parse
to fix thisThe text was updated successfully, but these errors were encountered: