I have a float variable such as "result". Lets say that result is the number 9.804. Then i would like to generate an arrange of elements in ascii as the following:
How can I do that? is there any function in CCS compiler for this purpose?
I would appreciatte any help on this matter.
Thanks!
Ttelmah Guest
Posted: Fri Aug 19, 2005 9:46 am
Code:
sprintf(text,"%5.3f",result);
Remember though that 'text' will need to be big enough to contain the string terminator as well (another character), and is safer made a little larger.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum