[issue35638] Introduce fixed point locale aware format type for floating point numbers

2019-01-03 Thread Łukasz Stelmach

Łukasz Stelmach  added the comment:

> I haven't looked at this closely yet, but you'll need to at least:
> - add tests that the locale-aware formatting is happening

Done.

> - support decimal
> - make sure it works with complex

Good points. Done. Please note, that there is an inconsistency between 
float/complex/int/_pydecimal(!) and decimal. The former provide only 'n' format 
type and the latter provides 'n' and 'N'. So I implemented 'm' and 'M' for 
decimal and 'm' for _pydecimal.

> (which it probably does, but needs a test)

There are no tests for 'n'. Should I create for both 'm' and 'n'?

> And, I think we'll need to run this through python-ideas first. One thing I 
> expect to come up there: why f and not g?

Because 'g' has been already covered with 'n'.

--

___
Python tracker 
<https://bugs.python.org/issue35638>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35638] Introduce fixed point locale aware format type for floating point numbers

2019-01-03 Thread Łukasz Stelmach

Łukasz Stelmach  added the comment:

As much as I am open to any suggestions for naming and such (although I think 
'm' together with 'n' are a good supplement for 'f' and 'g'), I really would 
like to introduce a method to format numbers with fixed number of decimal 
digits (it looks good in tables) and with separators from locale.

--

___
Python tracker 
<https://bugs.python.org/issue35638>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35638] Introduce fixed point locale aware format type for floating point numbers

2019-01-05 Thread Łukasz Stelmach

Łukasz Stelmach  added the comment:

Indeed. Thank you. I was sure I had tried this. However, this is still only a 
workaround and not the solution I need. I am working on a project now which 
uses pint https://pint.readthedocs.io/en/latest/ which uses format() and its 
relatives.

With "n" format present Python is missing locale-aware "f" formatter anyway.

--

___
Python tracker 
<https://bugs.python.org/issue35638>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35638] Introduce fixed point locale aware format type for floating point numbers

2019-01-09 Thread Łukasz Stelmach

Łukasz Stelmach  added the comment:

I'd appreciate, if we continued the discussion at python-ideas, where I posted 
the idea[1]. There has already been several valuable comments.

[1] https://mail.python.org/pipermail/python-ideas/2019-January/054793.html

--

___
Python tracker 
<https://bugs.python.org/issue35638>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com