Dai un'occhiata qui se è quello che cerchi
https://en.cppreference.com/w/cpp/io/manip/fixed