Posted 14 May 2008 - 09:32 AM
I'm wondering, How would I display decimals. I know its f, or a g. But I cant seem to get it to work.
Could you guys please give me an example of using sprintf to stick a floating point number into a string. Also how to make it rounded to 2 decimal places.
Posted 14 May 2008 - 01:23 PM
float test = 3.14159; char buffer; Bdisp_AllClr_VRAM(); sprintf(buffer, "%0.2f", test); PrintMini(1, 1, (unsigned char *)buffer, MINI_OVER); Bdisp_PutDisp_DD();
You also need to make sure that stdio.h is included:
Posted 14 May 2008 - 01:39 PM
So thats what was going wrong.
I wasnt including the file
It works now, so thanx alot. Also thanx for showing me the way to round them XD
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users