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. To get > thousands_sep to appear via Python's locale.format(), in all locales I've > tried so far it requires passing a true value for the optional "grouping" > argument. Like > > >>> import locale > >>> locale.setlocale(locale.LC_ALL, "german") > 'German_Germany.1252' > >>> x = 12345.0 > >>> locale.format("%g", x) # no thousands_sep > '12345' > >>> locale.format("%g", x, 1) > '12.345' > >>> At least with locale.format, if you want grouping, you pass in the third argument (grouping=1) to format(). An example: >>> locale.setlocale(locale.LC_NUMERIC, 'da_DK') 'da_DK' >>> locale.format("%.2f", 71630, 1) '71.630,00' Now, from the glibc docs: [...] 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 information indicates any. Note that many versions of gcc cannot parse this option and will issue a warning. SUSv2 does not include %'F. So unless I'm mistaken, this wouldn't really be an issue in our case if explicit grouping isn't requested inside the python conversion functions. Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
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