Re: [Python-ideas] [Python-Dev] Formatting mini-language suggestion

[Guido van Rossum]
I suggest moving this to python-ideas and writing a proper PEP.
Okay, it's moved. Will write up a PEP, do research on what other languages do and collect everyone's ideas on what to put in the shed. (hundreds and ten thousands grouping, various choices of decimal points, mayan number systems and whatnot). Will start with Nick's simple proposal as a starting point. [Nick Coghlan]
[[fill]align][sign][#][0][minimumwidth][,][.precision][type]
Other suggestions and comments welcome. Raymond

Raymond Hettinger writes:
+1 for making that the stopping point, too. I can't speak for the Chinese, but the Japanese also use the Chinese numbering system where the verbal expression of large numbers is grouped by 10000s. However, in tables of government expenditure and the like, the commas usually occur every three places. Eg, the official GDP figures from the Japanese Ministry of Economy and Trade: http://www.mext.go.jp/b_menu/toukei/001/08030520/013.htm

Stephen J. Turnbull wrote:
could maximumwidth be possible? It's useful if we rather break the display of the numbers than breaking the display of the table (and possibly add a special sign if width overflow occur, like <62432)
Should there should be a convenience function that will help construct the format string. Some kind of: create_format(self, type='i', base=16, seppos=4, sep=':', charset='0123456789abcdef', maxwidth=32, minwidth=32, pad='0') -- (cookies for you if you noticed that it is ipv6 number format)

Raymond Hettinger writes:
+1 for making that the stopping point, too. I can't speak for the Chinese, but the Japanese also use the Chinese numbering system where the verbal expression of large numbers is grouped by 10000s. However, in tables of government expenditure and the like, the commas usually occur every three places. Eg, the official GDP figures from the Japanese Ministry of Economy and Trade: http://www.mext.go.jp/b_menu/toukei/001/08030520/013.htm

Stephen J. Turnbull wrote:
could maximumwidth be possible? It's useful if we rather break the display of the numbers than breaking the display of the table (and possibly add a special sign if width overflow occur, like <62432)
Should there should be a convenience function that will help construct the format string. Some kind of: create_format(self, type='i', base=16, seppos=4, sep=':', charset='0123456789abcdef', maxwidth=32, minwidth=32, pad='0') -- (cookies for you if you noticed that it is ipv6 number format)
participants (3)
-
Lie Ryan
-
Raymond Hettinger
-
Stephen J. Turnbull