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

Printf %g behaves strangely with 0 precision. #14360

Closed
mason-bially opened this issue Dec 11, 2015 · 2 comments
Closed

Printf %g behaves strangely with 0 precision. #14360

mason-bially opened this issue Dec 11, 2015 · 2 comments
Labels
domain:display and printing Aesthetics and correctness of printed representations of objects. kind:bug Indicates an unexpected problem or unintended behavior status:help wanted Indicates that a maintainer wants help on an issue or pull request

Comments

@mason-bially
Copy link
Contributor

Discovered during #14331.

Namely these cases.

julia> @sprintf("%#.0g", 42)
"4.200000e+01"
c-> "4.e+01"

julia> @sprintf("%.0g", 42)
"4.2e+01"
c-> "4e+01"

julia> @sprintf("%.0g", 42.3)
"4.23e+01"
c-> "4e+01"

I'll be happy to take it.

@dfannius
Copy link
Contributor

Please do! I'll act as backstop if you don't get around to it.

@StefanKarpinski StefanKarpinski added domain:strings "Strings!" status:help wanted Indicates that a maintainer wants help on an issue or pull request labels Sep 13, 2016
@StefanKarpinski StefanKarpinski added this to the 0.5.x milestone Sep 13, 2016
@StefanKarpinski StefanKarpinski added status:help wanted Indicates that a maintainer wants help on an issue or pull request and removed status:help wanted Indicates that a maintainer wants help on an issue or pull request labels Oct 27, 2016
@JeffBezanson JeffBezanson added kind:bug Indicates an unexpected problem or unintended behavior domain:display and printing Aesthetics and correctness of printed representations of objects. and removed domain:strings "Strings!" labels May 21, 2018
@JeffBezanson JeffBezanson modified the milestones: 0.5.x, 1.0.x May 21, 2018
@quinnj
Copy link
Member

quinnj commented Sep 8, 2020

These cases are fixed in #32859

@quinnj quinnj closed this as completed Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:display and printing Aesthetics and correctness of printed representations of objects. kind:bug Indicates an unexpected problem or unintended behavior status:help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

No branches or pull requests

5 participants