Skip to content

<format>: Incorrect decimal point placement when using alternate form without a type #3003

Description

Igor Zhukov (@fsb4000) reported a bug in libc++'s format implementation. While investigating that bug I noticed that for a small part I'm in good company; MSVC STL has the same bug:

std::format("{:#.{}}\n", 1200.0 0);  // 1e+03. instead of 1.e+03
std::format("{:#.{}g}\n", 1200.0 0); // 1.e+03 as expected (types a, e, and f are good too.)

More examples at https://godbolt.org/z/fTsKaf6vz

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

    bugSomething isn't workingfixedSomething works now, yay!formatC++20/23 format

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions