Skip to content

gh-130860: fix width calculation, when separators in fractional part #130865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
address review: more tests
  • Loading branch information
skirpichev committed Mar 6, 2025
commit 8ae08c6611a520c5600d4a7b8cda43ffd35b73b3
12 changes: 12 additions & 0 deletions Lib/test/test_float.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,18 @@ def test_format(self):
self.assertEqual(format(x, '+.11,e'), '+1.234,561,234,56e+05')
self.assertEqual(format(x, '019_._f'), '000_123_456.123_456')
self.assertEqual(format(x, '021_.10_f'), '123_456.123_456_000_0')
self.assertEqual(format(x, '>021_._f'), '000000123_456.123_456')
self.assertEqual(format(x, '>021._f'), '0000000123456.123_456')
self.assertEqual(format(x, '<021_._f'), '123_456.123_456000000')
self.assertEqual(format(x, '<021._f'), '123456.123_4560000000')
self.assertEqual(format(x, '021._f'), '0000000123456.123_456')
self.assertEqual(format(x, '21._f'), ' 123456.123_456')
self.assertEqual(format(x, ' 21._f'), ' 123456.123_456')
self.assertEqual(format(x, 'z=21._f'), 'zzzzzzz123456.123_456')
self.assertEqual(format(x, 'z>21._f'), 'zzzzzzz123456.123_456')
self.assertEqual(format(x, 'z<21._f'), '123456.123_456zzzzzzz')
self.assertEqual(format(x, '019_._e'), '000_001.234_561e+05')
self.assertEqual(format(x, '021_.10_e'), '001.234_561_234_6e+05')

self.assertRaises(ValueError, format, x, '._6f')
self.assertRaises(ValueError, format, x, '.,_f')
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy