That should work. But if you are only using a couple of formats, I have found it is better not to use printf. For example, I use 3 digits with or without a decimal place. The routine that does the equivalent of printf("%5d",data); is quite a bit smaller since it doesn't have to handle float, hex, etc. I had to decide to store some numbers with an implied decimal place, but it was well worth it. Bruce Partridge http://www.rebreather.ca > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Jan-Erik Soderholm > Sent: Sunday, March 07, 2004 12:29 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]: Reduce flicker on Graphic LCD? > > > Thomas wrote : > > > It is a little more complicated. Let's say I have > > these codes: > > data = 12345; > > printf("%d",data); // LCD scr displays "12345" > > data = 9; > > printf("%d",data); // LCD scr displays: "92345" > > Hi. > I'm not sure what C compiler you use, but does it > accept the following : > > data = 12345; > printf("%5d",data); > data = 9; > printf("%5d",data); > > That should provide with "padding" with space > characters up to 5 characters total. Not sure if it > will be left or right padding.... > > > Regards > Jan-Erik. > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.596 / Virus Database: 379 - Release Date: 2/26/2004 > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.596 / Virus Database: 379 - Release Date: 2/26/2004 -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads