Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Conversion of scientific floats #53

Closed
nielsls opened this issue Nov 29, 2021 · 0 comments · Fixed by #71
Closed

Conversion of scientific floats #53

nielsls opened this issue Nov 29, 2021 · 0 comments · Fixed by #71

Comments

@nielsls
Copy link

nielsls commented Nov 29, 2021

Decimals.scinote(str) errors when the number of decimals in the scientific number is higher than the exponent.

julia> x = 1.2345678e6
1.2345678e6

julia> Decimal(x)
ERROR: ArgumentError: can't repeat a string -1 times
Stacktrace:
 [1] repeat(s::String, r::Int64)
   @ Base .\strings\substring.jl:226
 [2] scinote(str::String)
   @ Decimals C:\Users\nls\.julia\packages\Decimals\Sb4j1\src\decimal.jl:37
 [3] parse(#unused#::Type{Decimal}, str::String)
   @ Decimals C:\Users\nls\.julia\packages\Decimals\Sb4j1\src\decimal.jl:4
 [4] Decimal(num::Float64)
   @ Decimals C:\Users\nls\.julia\packages\Decimals\Sb4j1\src\decimal.jl:13
 [5] top-level scope
   @ REPL[164]:1
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant