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

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).



I'm a backend software developer and modern C++ junkie. I run a modern cpp youtube channel (https://www.youtube.com/@masteringmoderncppfeatures6302/videos)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store