On Tue, Sep 02, 2003 at 11:29:55AM -0400, Tim Peters wrote: > OTOH, *are* there locales that insert thousands_sep? I don't know. [...] > There's no support there for the notion that "the formatted (etc)" functions > *can* be affected by thousands_sep, just that fiddling locale can affect > decimal-point and the (passive) values returned by localeconv(). The Linux/glibc documentation, which cites SUSv2, seems to imply that no locale inserts the thousands separator in formatting operations, except when the ' flag character is included: For some numeric conversions a radix character ('decimal point') or thousands' grouping character is used. The actual character used depends on the LC_NUMERIC part of the locale. The POSIX locale uses '.' as radix character, and does not have a grouping character. Thus, printf("%'.2f", 1234567.89); results in '1234567.89' in the POSIX locale, in '1234567,89' in the nl_NL locale, and in '1.234.567,89' in the da_DK locale. [...] The five flag characters above are defined in the C standard. The SUSv2 specifies one further flag character. ' For decimal conversion (i, d, u, f, F, g, G) the output is to be grouped with thousands' grouping characters if the locale infor- mation indicates any. Note that many versions of gcc cannot parse this option and will issue a warning. SUSv2 does not include %'F. Jeff
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4