Author |
Message |
Topic: Question about sprintf and float variables |
ccdart
Replies: 3
Views: 7289
|
Forum: General CCS C Discussion Posted: Tue Jan 25, 2005 4:46 pm Subject: Question about sprintf and float variables |
Yup! That does it. I also tried four decimal places and adding .000049, and that seems to work as well. (Though I wonder if that's treading on thin ice...)
Thanks again for the solution! |
Topic: Question about sprintf and float variables |
ccdart
Replies: 3
Views: 7289
|
Forum: General CCS C Discussion Posted: Tue Jan 25, 2005 4:36 pm Subject: Question about sprintf and float variables |
Okay, that's pretty much what I was expecting to hear. I'll try your suggestion ASAP... if true, it should be good enough. |
Topic: Question about sprintf and float variables |
ccdart
Replies: 3
Views: 7289
|
Forum: General CCS C Discussion Posted: Tue Jan 25, 2005 4:02 pm Subject: Question about sprintf and float variables |
Here is a short test program:
// fuses, etc. not shown
void main(void)
{
signed int8 c=100;
float value=0;
char ascout[20];
value = (float)c;
sprintf(ascout,"%f",value);
}
Now, I'm u ... |
|