We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Following code example shows, that format_to and format_to_n fails to format floats while using option '='. (fmtlib version 5.0.0)
#include <fmt/format.h> #include <array> #include <cassert> #include <string> using namespace fmt; int main() { std::array<char, 6> buffer; auto format = "{0:0=+6.2f}"; // passing case assert(fmt::format(format, -3.8) == "-03.80"); // failing cases assert(fmt::format_to(buffer.begin(), format, 3.21) == buffer.end()); // got buffer.end() -1 assert(std::string(buffer.data(), buffer.size()) == "+03.21"); // got "03.21 " assert(fmt::format_to_n(buffer.begin(), buffer.size(), format, -1.23).size == buffer.size()); // got 5 instead of 6 assert(std::string(buffer.data(), buffer.size()) == "-01.23"); // got "01.23 " }
The text was updated successfully, but these errors were encountered:
Fix FP formatting to a non-back_insert_iterator with sign & numeric a…
fc6e0fe
…lignment (#756)
Fixed in fc6e0fe & 1b8a7f8, thanks a lot for reporting!
Sorry, something went wrong.
No branches or pull requests
Following code example shows, that format_to and format_to_n fails to format floats while using option '='. (fmtlib version 5.0.0)
The text was updated successfully, but these errors were encountered: