python-dev
[Prev] Thread [Next] | [Prev] Date [Next]
Re: [Python-Dev] Formatting mini-language suggestion James Y Knight Wed Mar 11 19:00:34 2009
On Mar 11, 2009, at 9:06 PM, Nick Coghlan wrote:
Raymond Hettinger wrote:The current formatting mini-language provisions left/right/center alignment, prefixes for 0b 0x 0o, and rules on when to show the plus-sign. I think it would be far more useful to provision a simple way of specifying a thousands separator.Financial users in particular find the locale approach to be frustrating and non-obvious. Putting in a thousands separator is a common task foroutput destined to be read by non-programmers.+1 for the general idea. A specific syntax proposal: [[fill]align][sign][#][0][minimumwidth][,sep][.precision][type]'sep' is the new field that defines the thousands separator. It appears immediately before the precision specifier and starts with a leading comma.I believe this syntax is unambiguous and backwards compatible because the only other place a comma might appear (the fill field) is required to be followed by an alignment character.
You might be interested to know that in India, the commas don't come every 3 digits. In india, they come every two digits, after the first three. Thus one billion = 1,00,00,00,000. How are you gonna represent *that* in a formatting mini-language? :)
See also http://en.wikipedia.org/wiki/Indian_numbering_system James _______________________________________________ Python-Dev mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/alexiscircle%40gmail.com
- [Python-Dev] Formatting mini-language suggestion Raymond Hettinger
- Re: [Python-Dev] Formatting mini-language suggestion Antoine Pitrou
- Re: [Python-Dev] Formatting mini-language suggestion Guido van Rossum
- Re: [Python-Dev] Formatting mini-language suggestion Raymond Hettinger
- Message not available
- Re: [Python-Dev] Formatting mini-language suggestion Guido van Rossum
- Re: [Python-Dev] Formatting mini-language suggestion Nick Coghlan
- Re: [Python-Dev] Formatting mini-language suggestion James Y Knight <=
- Re: [Python-Dev] Formatting mini-language suggestion Raymond Hettinger
- Re: [Python-Dev] Formatting mini-language suggestion Nick Coghlan
- Re: [Python-Dev] Formatting mini-language suggestion James Y Knight
- Re: [Python-Dev] Formatting mini-language suggestion Lie Ryan
- Re: [Python-Dev] Formatting mini-language suggestion Raymond Hettinger
- Re: [Python-Dev] Formatting mini-language suggestion Jeroen Ruigrok van der Werven
- Re: [Python-Dev] Formatting mini-language suggestion Ben Finney
- Re: [Python-Dev] Formatting mini-language suggestion Greg Ewing
Re: [Python-Dev] Formatting mini-language suggestion Greg Ewing
- Re: [Python-Dev] Formatting mini-language suggestion Stephen J. Turnbull