C++20 String Formatting: Part-3 Sign specification

Gajendra Gulgulia
5 min readMar 8, 2023

In the second part of the tutorial series, we looked at the general structure of format specifiers and later looked into the details of how to specify the width, fill and alignment in the string formatting library. In this part of the series, we will look at how to specify the sign ( + , - ) (aka the sign format specifier) to numbers (marked green in the image below).

--

--