[issue33731] string formatting that produces floats with preset precision while respecting locale

2019-08-14 Thread Cédric Krier
Cédric Krier added the comment: I think PR-15275 will solves this issue also as you could use: >>> locale.setlocale(locale.LC_ALL, 'fr_FR') >>> locale.localize('{:.2f}'.format(1.891)) '1,89' -- nosy: +ced ___ Python tracker

[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-08-04 Thread Stefan Krah
Change by Stefan Krah : -- nosy: +skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-08-01 Thread James Emerton
James Emerton added the comment: @rhettinger See #34311 about formatting Decimals using locale.format(). I'd like to see the problem fixed in one place or the other. Also, this is seems relatively straightforward to implement as it's really just a combination of the fixed precision 'f' and

[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-08-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: I would like to see locale() remain somewhat decoupled from the rest of string formatting. IIRC locale() is finicky especially when concurrency is involved. I think a best practice is for an app to address locale issues explicitly rather than inside

[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-08-01 Thread James Emerton
James Emerton added the comment: So far, I've implemented this for Decimal -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-08-01 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +8118 stage: -> patch review ___ Python tracker ___ ___

[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-08-01 Thread James Emerton
Change by James Emerton : -- nosy: +jemerton ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-06-01 Thread Eric V. Smith
Eric V. Smith added the comment: You can always use the locale module, although of course that's not as convenient: >>> locale.format('%.2f', 1.891) '1.89' I'm open to suggests on backward compatible ways to implement this for python 3.8. It would probably involve a new letter, and need to

[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-06-01 Thread Jakub Szewczyk
New submission from Jakub Szewczyk : .2f produces a string representation of a float rounded up to 2 significant digits. >>> print ("{:.2f}".format(1.891)) 1.89 However, it does not respect locale. There is no counterpart of 'f' that would respect locale. There is 'n', but because it