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

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

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


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] sprintf - formated output as XXX.XXX.XXX
Date: Sun, 23 Jan 2005 11:42:22 +0100 (MET)

As honschu <address@hidden> wrote:

>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.

The modifier is "'" (the apostrophe), "f" is already the format.  It
cannot only be applied to the floating-point formats, but also to
integer formats.

Sorry, no, this is not implemented.  It's not even part of the C99
standard (which we already don't implement in full) but is an X/Open
System Interfaces Extension standardized in the Single Unix
Specification.

Implementing it would not only require even more code, but would
basically also require implementing localization, as e.g. we Germans
would want to use a comma as the decimal separator, and a dot to
separate the thousands groups.  The main reason for not implementing
it is that it would bloat the code even more, though I'm tempted to at
least implement an option for the decimal dot localization some day,
as it can become a serious point for people who want to base
real-world applications on it, and are going to use it outside the
English-language world.  I think the decimal dot feature can be done
without too much code bloat.

About adding more features to vfprintf in general, I think we would
need even more options to select from then (minimal vs. standard vs.
floating point vs. "all included") than we have now.  I'm not entirely
happy with the way it's done right now (through linker magic), but
have yet to see a better way.  Any ideas welcome.
-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/


reply via email to

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