This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Retro
Recipients JJeffries, Retro, belopolsky, christian.heimes, eric.araujo, georg.brandl, ixokai, tim.golden, twouters
Date 2010-10-21.01:43:27
SpamBayes Score 1.274536e-13
Marked as misclassified No
Message-id <AANLkTikRL89GavNsfjShFSdEna4e7E2WHTOF1HMbnAcR@mail.gmail.com>
In-reply-to <AANLkTinsqN94+=7PpyM7_UOyL6cFJoZUhpywTYJDdKhe@mail.gmail.com>
Content
Please respond...

On Wed, Oct 20, 2010 at 7:05 PM, Boštjan Mejak <report@bugs.python.org>wrote:

>
> Boštjan Mejak <bostjan.mejak@gmail.com> added the comment:
>
> Thank you so much for your answer. The
> locale.setlocale(category=locale.LC_NUMERIC,
> locale="Slovenian")  works like a charm in my application. Now the 'n'
> format specifier works as I want. But tell me whether the 'n' format
> specifier can be forced to round the float to just one decimal place. I
> know
> that the 'f' format specifier does that by specifying ".1f", but 'f' is not
> locale-aware. I have set the 'n' format specifier in my application like
> ".3n", which is okay if the returned number is two integers and one
> decimal,
> but is not okay if the returned number is one integer and two decimals,
> because I want just one decimal, always. How can I make that by using the
> 'n' format specifier?
>
> On Wed, Oct 20, 2010 at 11:37 AM, Tim Golden <report@bugs.python.org>
> wrote:
>
> >
> > Tim Golden <mail@timgolden.me.uk> added the comment:
> >
> > Boštjan, the code segment you quote is the *fallback* if the
> > C module hasn't been built for some reason. The module simply
> > calls through to the underlying C Library. I notice you're
> > running on Windows, so this is a useful MS page:
> >
> > http://msdn.microsoft.com/en-us/library/x99tb11d%28VS.71%29.aspx
> >
> > and you can see there that a call of setlocale (LC_ALL, "English")
> > is valid (of "French" if you prefer):
> >
> > Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit
> > (Intel)] on win32
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import locale
> > >>> locale.setlocale (locale.LC_ALL, "French")
> > 'French_France.1252'
> > >>>
> >
> > ----------
> > nosy: +tim.golden
> >
> > _______________________________________
> > Python tracker <report@bugs.python.org>
> > <http://bugs.python.org/issue10092>
> > _______________________________________
> >
>
> ----------
> Added file: http://bugs.python.org/file19306/unnamed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue10092>
> _______________________________________
>
Files
File name Uploaded
unnamed Retro, 2010-10-21.01:43:25
History
Date User Action Args
2010-10-21 01:43:29Retrosetrecipients: + Retro, twouters, georg.brandl, ixokai, belopolsky, christian.heimes, tim.golden, eric.araujo, JJeffries
2010-10-21 01:43:27Retrolinkissue10092 messages
2010-10-21 01:43:27Retrocreate