Author |
Message |
Topic: print using %f |
betomax
Replies: 7
Views: 9167
|
Forum: General CCS C Discussion Posted: Thu Aug 20, 2009 1:53 pm Subject: print using %f |
you will have to check if the
value is negative before calling the appropriate printf statement.
Is exactly what I did, Thanks it works perfect !!! |
Topic: print using %f |
betomax
Replies: 7
Views: 9167
|
Forum: General CCS C Discussion Posted: Thu Aug 20, 2009 1:11 pm Subject: print using %f |
You can also put a "0" in front
of the first digit to zero-fill it on the left side, where applicable.
Thanks by reply, and yes actually I'm trying under mplab sim, but I don't un ... |
Topic: print using %f |
betomax
Replies: 7
Views: 9167
|
Forum: General CCS C Discussion Posted: Thu Aug 20, 2009 12:31 pm Subject: print using %f |
I tried also:
printf("Current voltage =%02.2f\r\n",voltage_var);
but still sending "Current voltage = 1.XX" |
Topic: print using %f |
betomax
Replies: 7
Views: 9167
|
Forum: General CCS C Discussion Posted: Thu Aug 20, 2009 12:11 pm Subject: print using %f |
Hi
I have to send a float number
float voltage_var;
.
printf("Current voltage =%2.2f\r\n",voltage_var);
.
It works but I need my output string always same length, I mean if ... |
|