Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - In C language, in the data format of printf, there is a small doubt about the data output width.
In C language, in the data format of printf, there is a small doubt about the data output width.

For integer type %.4d is the same as %04d. Add 0 in front and output 4 bits.

For floating point types.

%.nf is reserved to n decimal places.

%m.nf is to output n decimal places, including decimals, integers, and the whole decimal point occupies m places.