Skip to content
This repository was archived by the owner on Mar 1, 2024. It is now read-only.
This repository was archived by the owner on Mar 1, 2024. It is now read-only.

skip decimal point when 0 decimal digits are requested #97

Description

@alusiani

When no decimal digits are requested, no decimal digits are formatted, but the decimal point is still included. This is different from printf in C and from format in Python, which omit the decimal point in this case.

Example in Python:

"{:.0f}".format(123.4)
## result: '123'

Example in Julia

using Formatting
fmt(".0f", 123.4)
## result: "123."
format("{:.0f}", 123.4)
## result: "123."

Would it be possible to change this behaviour and make it the same as C printf() and Python format()?

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