Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Differences between %5.4d and %5d in C language
Differences between %5.4d and %5d in C language
%d is output shaping. % 5.4d. The number before the decimal point (5) is the width of the output data, which is aligned to the left, and less than 5 digits are output in spaces; The number after the decimal point (4) refers to the number of digits retained after the decimal point of the output data, which is rounded off and output. The default is to output six decimal places.

In %5d, that is, as mentioned above, the width of output data, such as Arabic numeral "1" in %d, occupies a width, and it is 1 when output, and 1 when output in %5d, with four spaces in front of it.