Hello All.
Im new to C and need some help.
How do u set a float point variable to print to tqo decimal places.
is it:
printf("Bla Bla Bla %f, number);
do i put say .2%f
Please Help Me
TyrioN
Hello All.
Im new to C and need some help.
How do u set a float point variable to print to tqo decimal places.
is it:
printf("Bla Bla Bla %f, number);
do i put say .2%f
Please Help Me
TyrioN
close but you put the % then the precision then the spcifier f for the float.
this link gives more infoCode:printf("%.2f",number);
http://msdn.microsoft.com/library/de..._controlfp.asp
"Knowledge is proud that she knows so much; Wisdom is humble that she knows no more."
-- Cowper
Operating Systems=Slackware Linux 9.1,Windows 98/Xp
Compilers=gcc 3.2.3, Visual C++ 6.0, DevC++(Mingw)
You may teach a person from now until doom's day, but that person will only know what he learns himself.
Now I know what doesn't work.
A problem is understood by solving it, not by pondering it.
For a bit of humor check out xkcd web comic http://xkcd.com/235/