Skip to content
New issue

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

Conversion of scientific floats #53

Open
nielsls opened this issue Nov 29, 2021 · 0 comments
Open

Conversion of scientific floats #53

nielsls opened this issue Nov 29, 2021 · 0 comments

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant