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
round with the digits/sigdigits keyword only really works with quantities based on floating-point numbers:
round
digits
sigdigits
julia> round(u"m", (120//1)u"cm", sigdigits=2) 5404319552844595//4503599627370496 m julia> round(u"m", 120u"cm", sigdigits=2) ERROR: InexactError: Int64(1.2)
For unitless numbers, round always returns a float when sigdigits/digits is used. Maybe Unitful should do the same.
julia> round(120//100, sigdigits=2) 1.2 julia> round(125, sigdigits=2) 120.0
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
round
with thedigits
/sigdigits
keyword only really works with quantities based on floating-point numbers:For unitless numbers,
round
always returns a float whensigdigits
/digits
is used. Maybe Unitful should do the same.The text was updated successfully, but these errors were encountered: