Skip to content

Printf %g behaves strangely with 0 precision. #14360

Closed

Description

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviordisplay and printingAesthetics and correctness of printed representations of objects.help wantedIndicates that a maintainer wants help on an issue or pull request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions