Float fraction digits

Last update in 9/2019

All you really need to do is add .2 (for 2 fraction digits) between % and f in printf function.

Here is working example:

#include <stdio.h>

int main () {
float pi;

pi = 3.1415;

printf("Pi: %.2f", pi);

return 0;
}

That's all there is to it!