Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@mordante

Description

@mordante

@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

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