Skip to content

Support char as number #55

Closed
Closed
@tarwich

Description

@tarwich

This should return 0x61, but instead fails saying it needs a numeric type instead of a character type.

fmt::format("0x{0:02X}", 'a'); // Crashes

This, however, succeeds:

fmt::format("0x{0:02X}\n", (int)'a'); // Returns 0x61

Activity

vitaut

vitaut commented on Jul 21, 2014

@vitaut
Contributor

Since char is technically an integral type, I think you are right and this should be supported. Thanks for reporting!

added a commit that references this issue on Jul 22, 2014
fe615bb
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

      Support char as number · Issue #55 · fmtlib/fmt