In my printf, I need to use %f but I'm not sure how to truncate to 2 decimal places:
printf
%f
Example: getting
3.14159
to print as:
3.14
Use this:
printf ("%.2f", 3.14159);
2.1m questions
2.1m answers
60 comments
57.0k users