The format library (C++20) offers text formatting with an interface that is more in line with the C printf-style functions (and their formatting options).
However, unlike the C formatting functions, the format is parsed and checked at compile time, leading to better safety and performance.
Compiler Explorer link: https://compiler-explorer.com/z/f6crdPo33