meta data for this page
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
programming:c:printf [2020/04/02 14:42] niziak created |
programming:c:printf [2024/05/21 19:17] (current) niziak |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== printf ====== | ||
+ | |||
====== Cross platform format string ====== | ====== Cross platform format string ====== | ||
Line 11: | Line 13: | ||
[[https://www.cplusplus.com/reference/cinttypes/]] | [[https://www.cplusplus.com/reference/cinttypes/]] | ||
[[https://stackoverflow.com/questions/174612/cross-platform-format-string-for-variables-of-type-size-t/174674#174674]] | [[https://stackoverflow.com/questions/174612/cross-platform-format-string-for-variables-of-type-size-t/174674#174674]] | ||
+ | |||
+ | ====== Float padding ====== | ||
+ | |||
+ | The field //width// includes the decimal point and the fractional portion (and the sign, if it's negative). | ||
+ | |||
+ | |||
+ | ===== Padding negative numbers ===== | ||
+ | Flags: | ||
+ | * ''-'' Left-justify the given field width (see Width below). Right justification is the default. | ||
+ | * ''+'' Forces a "+" sign to precede a number. Has no effect on negative numbers. | ||
+ | * ''(space)'' One blank space is inserted before a positive number, while negative numbers are unaffected. This is useful for making positive and negative numbers vertically align in a visual stacked list. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||