MAX
10-13-2007, 05:33 AM
Hello,
I need to print only 2 decimals on the output.
Let's say I have this code:
int a = 5;
int b = 16;
double c = a / b;
the result is 0.3125.
If I want to print only 0.31, how should the correct print code be?
Thanks.
I need to print only 2 decimals on the output.
Let's say I have this code:
int a = 5;
int b = 16;
double c = a / b;
the result is 0.3125.
If I want to print only 0.31, how should the correct print code be?
Thanks.