[Python-ideas] Format mini-language for lakh and crore
David Mertz
mertz at gnosis.cx
Thu Feb 1 11:05:15 EST 2018
On Feb 1, 2018 12:17 AM, "Stephan Houben" <stephanh42 at gmail.com> wrote:
What about something like:
f"{x:₹d}"
₹ = Indian Rupees symbol
I realize it is not ASCII but ₹ would be, for the target audience,
both easy to type and be mnemonic
("format number like you would format an amount in rupees").
I like how iconic it is very much. However...
There are two obstacles to this. The main one is the BDFLs often declared
opposition to using non-ASCII in Python itself. The format mini-language is
borderline between being part of the Python language and merely being
strings you can quote (which strongly need to allow non-ASCII literals).
It's a lot like regex or glob this way (but for historic reasons at least,
both those are also pure ASCII in their syntax elements, but can obviously
match non-ASCII literals or classes).
The other element is that not all of South Asia is India.
U+09F3 <http://www.fileformat.info/info/unicode/char/09f3/index.htm> BENGALI
RUPEE SIGN ৳
U+0AF1 <http://www.fileformat.info/info/unicode/char/0af1/index.htm> GUJARATI
RUPEE SIGN ૱
U+0BF9 <http://www.fileformat.info/info/unicode/char/0bf9/index.htm> TAMIL
RUPEE SIGN ௹I believe U+02A8 ₨ is deprecated in India but still used in
Pakistan.
However, the discussion also let me to find your on Wikipedia, which also
urged towards Nick's more general pattern specifier:
Outside of Taiwan, digits are sometimes grouped by myriads instead of
thousands. Hence it is more convenient to think of numbers here as in
groups of four, thus 1,234,567,890 is regrouped here as 12,3456,7890.
Larger than a myriad, each number is therefore four zeroes longer than the
one before it,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180201/16b9e130/attachment.html>
More information about the Python-ideas
mailing list