avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] sprintf - formated output as XXX.XXX.XXX


From: honschu
Subject: [avr-gcc-list] sprintf - formated output as XXX.XXX.XXX
Date: Thu, 6 Jan 2005 16:44:04 +0100
User-agent: KMail/1.6.2

Hi,

I have finally built up a simple and stable program which prints out
some values to a LCD.

More general info:
A FPGA measures the H-Sync and V-Sync of a VGA-Signal. 
My ATmega16 is reading these values and prints them out.

This is the current simplified code:

unsigned char lcd_str1[20];
sprintf( lcd_str1, "HSync %lu", value );
lcd_puts( lcd_str1 );

the LCD prints out something like: "HSync 80000000"
but because of the big values, I would love to get a more readable format 
output as "HSync 80.000.000".

Can anyone please help me?


In the normal Linux-PC libc docu "man 3 printf" there they talk about a
"'f" modifier which is based on the locale LC_NUMERIC.

But for avrlibc I cannot find any info in "how to group the thousands".
I looked for in:
http://www.nongnu.org/avr-libc/user-manual/group__avr__stdio.html#ga1


regards
 Rieker Flaik


reply via email to

[Prev in Thread] Current Thread [Next in Thread]