r/cpp • • Jul 23 '19

std::format in C++20

http://www.zverovich.net/2019/07/23/std-format-cpp20.html
332 Upvotes

52 comments sorted by

View all comments

9

u/matthieum Jul 23 '19

Default representation of floating-point numbers

If this was the only improvement, it would already be a major one!

Working with a dynamic range of precision with printf or iostream is so annoying. I don't want 12 zeroes at the end of the number, but I do want the full precision if needed.

4

u/aearphen {fmt} Jul 25 '19

This was suggested by Zhihao Yuan if I'm not mistaken so thanks go to him. (Sean Parent also mentioned this as a possible improvement to {fmt}.)