Skip to content

:g does not behave as python for floating point numbers #126

@guibou

Description

@guibou

With PyF:

ghci> x = 1.0 :: Double
ghci> [fmt|{x}|]
"1.0"
ghci> [fmt|{x:g}|]
"1.000000"

In Python

>>> f"{1.0:g}"
'1'

That's convenient because it allows the user to trim the trailing 0 and . if any.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions