CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Search found 4 matches
CCS Forum Index
Author Message
  Topic: print using %f
betomax

Replies: 7
Views: 9167

PostForum: 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 !!! Smile
  Topic: print using %f
betomax

Replies: 7
Views: 9167

PostForum: 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

PostForum: 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

PostForum: 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 ...
 
Page 1 of 1
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group