Skip to content

Engineering Notation fails with small precision #49

Description

@laborg

If precision is set to 1 (or 2 for negative numbers) the wrong number is shown.

julia> Showoff.format_fixed_scientific(1e-7, 1, true)
"10×10⁻⁹"

Correct but looking strange :

julia> Showoff.format_fixed_scientific(1e-8, 1, true)
"10.×10⁻⁹"

With precision being large enough, negative values are technically correct, but differ from expectation:

julia> Showoff.format_fixed_scientific(1e-3, 3, true)
"1000.×10⁻⁶"  # should probably be 1.0×10⁻³"

julia> Showoff.format_fixed_scientific(1e-4, 3, true)
"100.0×10⁻⁶"

julia> Showoff.format_fixed_scientific(1e-5, 3, true)
"10.00×10⁻⁶"

julia> Showoff.format_fixed_scientific(1e-6, 3, true)
"1000.×10⁻⁹" # should probably be 1.0×10⁻⁶"

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions