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
locale.format question #41833
Comments
locale.format is returning send("234,5") rather than send -------------------------------------------------------------------------- Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more
information.
>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'English_United
States.1252')
'English_United States.1252'
>>> data=2345
>>> locale.format('send("%d")', data, grouping = True)
'send("234,5")'
>>> locale.format('%d', data, grouping = True)
'2,345'
>>> |
Logged In: YES locale.format is implemented very "pragmatic". For example, locale.format('"1.%d."', 123) ("too many decimal points") though this should be supported. IMHO, format should first separate the % escapes from the |
Logged In: YES Berk, Thanks. |
The last comment set this issue to 'remind' in case someone wanted to fix it in the future...it's pretty much fixed now. format_string was added in 2.5, and in 2.6 format only accepts a string containing just a format code. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: