I keep stumbling on the format specifiers for the printf() family of functions. What I want is to be able to print a double (or float) with a maximum given number of digits after the decimal point. If I use:
printf("%1.3f", 359.01335); printf("%1.3f", 359.00999);
Instead of the desired
Can anybody help me?
© Stack Overflow or respective owner