Created: 2023-08-16 16:08
Status: #concept
Subject: Programming
Tags: C Strings stdio.h

Conversion Specifier

They help us specify how the compiler will transform Expressions into Strings, notably their:

%m.pX

printf("%10.2f\n", 3.142f);
printf("%10.2f\n", 12.69f);

/*** OUTPUT ***/
------3.14
-----12.69

printf("%-10.2f\n", 3.142f);
printf("%-10.2f\n", 12.69f);

/*** OUTPUT ***/
3.14------
12.69-----

References