c++ - Left of the dot precision -
what i'm trying write this
file << somefunction(5) << hex << 3;
and output 00003
instead of 3 (and 300 00300, etc)
note:- sorry if asked before, don't know term search this
edit:- mean zero's left, included hex part clear want compatible format
i believe mean.
#include <iostream> #include <iomanip> int main() { std::cout << std::setw(5) << std::setfill('0') << 3 << '\n'; return 0; }
output
00003
edit: also, see std::internal
at question.
Comments
Post a Comment