r/cpp • • Jun 26 '26

Improvements to std::format in C++26

https://mariusbancila.ro/blog/2026/06/19/improvements-to-stdformat-in-c26/
91 Upvotes

38 comments sorted by

View all comments

Show parent comment

3

u/rdtsc Jun 27 '26

Also trailing zeros are not printed in the default format.

Yeah my explanation was a bit incomplete. I mean there's no way to do something like {0:.###} in .NET, which prints up to three fractional digits (except trailing zeroes). It's trivial to do when having all significand digits and the place of the decimal point (as fmt has among its last steps), but cumbersome and inefficient from the outside.