Thread: printf problem
View Single Post
  #8   Spotlight this post!  
Unread 31-01-2005, 13:19
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,817
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: printf problem

Quote:
Originally Posted by gwross
You're going to want to be sure leading zeroes are printed for the fractional part. Does this printf implementation support "%03d"?
That's very true. I neglected that.
We should verify that the leading zeros can be forced. I'll call one of my kids later to test it on the controller at school to be sure.

[edit] That is supported (and has been tested), so the corrected printf would read:
Code:
printf("f = %d.%03d \r", i, i2);
Thanks Greg.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 31-01-2005 at 14:11.