hi
i just discovered the [locale][1] module in Python, and i've tried to
use it with Tornado Template but i get a bizarre bizarre rendering, so
1000 will become 1 000, so i cant get the good separator, i tried
both: the comma (system default) and the space (french)
here is the code:
NB: it seems that i dont render here the value, it's an interrogation
mark in a diamond shape.
On 18 oct, 14:22, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
> hi
> i just discovered the [locale][1] module in Python, and i've tried to
> use it with Tornado Template but i get a bizarre bizarre rendering, so
> 1000 will become 1 000, so i cant get the good separator, i tried
> both: the comma (system default) and the space (french)
> here is the code:
> NB: it seems that i dont render here the value, it's an interrogation
> mark in a diamond shape.
> On 18 oct, 14:22, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
> > hi
> > i just discovered the [locale][1] module in Python, and i've tried to
> > use it with Tornado Template but i get a bizarre bizarre rendering, so
> > 1000 will become 1 000, so i cant get the good separator, i tried
> > both: the comma (system default) and the space (french)
> > here is the code:
> update2: there is '{:,}'.format(price) but this only uses a comma as a
> separator.
> On 18 oct, 14:40, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
> > NB: it seems that i dont render here the value, it's an interrogation
> > mark in a diamond shape.
> > On 18 oct, 14:22, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
> > > hi
> > > i just discovered the [locale][1] module in Python, and i've tried to
> > > use it with Tornado Template but i get a bizarre bizarre rendering, so
> > > 1000 will become 1 000, so i cant get the good separator, i tried
> > > both: the comma (system default) and the space (french)
> > > here is the code:
You can also use PyICU. It's not documented and they point you to the
C++ API documentation, but it's good enough since the Python API looks
a lot like the C++ API.
On Thu, Oct 18, 2012 at 4:52 PM, aliane abdelouahab
> On 18 oct, 14:45, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
>> update2: there is '{:,}'.format(price) but this only uses a comma as a
>> separator.
>> On 18 oct, 14:40, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
>> > NB: it seems that i dont render here the value, it's an interrogation
>> > mark in a diamond shape.
>> > On 18 oct, 14:22, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
>> > > hi
>> > > i just discovered the [locale][1] module in Python, and i've tried to
>> > > use it with Tornado Template but i get a bizarre bizarre rendering, so
>> > > 1000 will become 1 000, so i cant get the good separator, i tried
>> > > both: the comma (system default) and the space (french)
>> > > here is the code:
> You can also use PyICU. It's not documented and they point you to the
> C++ API documentation, but it's good enough since the Python API looks
> a lot like the C++ API.
> On Thu, Oct 18, 2012 at 4:52 PM, aliane abdelouahab
> > On 18 oct, 14:45, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
> >> update2: there is '{:,}'.format(price) but this only uses a comma as a
> >> separator.
> >> On 18 oct, 14:40, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
> >> > NB: it seems that i dont render here the value, it's an interrogation
> >> > mark in a diamond shape.
> >> > On 18 oct, 14:22, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
> >> > > hi
> >> > > i just discovered the [locale][1] module in Python, and i've tried to
> >> > > use it with Tornado Template but i get a bizarre bizarre rendering, so
> >> > > 1000 will become 1 000, so i cant get the good separator, i tried
> >> > > both: the comma (system default) and the space (french)
> >> > > here is the code:
<alabdeloua...@gmail.com> wrote:
> will be faster than Babel? because i need only the currency formatting
> option, and it worked good using Babel.
> On 19 oct, 11:05, Frank Smit <fr...@61924.nl> wrote:
>> You can also use PyICU. It's not documented and they point you to the
>> C++ API documentation, but it's good enough since the Python API looks
>> a lot like the C++ API.
>> On Thu, Oct 18, 2012 at 4:52 PM, aliane abdelouahab
>> > On 18 oct, 14:45, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
>> >> update2: there is '{:,}'.format(price) but this only uses a comma as a
>> >> separator.
>> >> On 18 oct, 14:40, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
>> >> > NB: it seems that i dont render here the value, it's an interrogation
>> >> > mark in a diamond shape.
>> >> > On 18 oct, 14:22, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
>> >> > > hi
>> >> > > i just discovered the [locale][1] module in Python, and i've tried to
>> >> > > use it with Tornado Template but i get a bizarre bizarre rendering, so
>> >> > > 1000 will become 1 000, so i cant get the good separator, i tried
>> >> > > both: the comma (system default) and the space (french)
>> >> > > here is the code:
finally i think i'll stick with Babel, because PyICU need visual
studio to compile on windows, and am trying to test the application on
windows (i've a laptop that uses optimus and it's not good with linux)
thank you again :)
On 19 oct, 16:23, Frank Smit <fr...@61924.nl> wrote:
> I don't know if it's faster. I use it because it works on Python 3.
> On Fri, Oct 19, 2012 at 4:07 PM, aliane abdelouahab
> <alabdeloua...@gmail.com> wrote:
> > will be faster than Babel? because i need only the currency formatting
> > option, and it worked good using Babel.
> > On 19 oct, 11:05, Frank Smit <fr...@61924.nl> wrote:
> >> You can also use PyICU. It's not documented and they point you to the
> >> C++ API documentation, but it's good enough since the Python API looks
> >> a lot like the C++ API.
> >> On Thu, Oct 18, 2012 at 4:52 PM, aliane abdelouahab
> >> > On 18 oct, 14:45, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
> >> >> update2: there is '{:,}'.format(price) but this only uses a comma as a
> >> >> separator.
> >> >> > NB: it seems that i dont render here the value, it's an interrogation
> >> >> > mark in a diamond shape.
> >> >> > On 18 oct, 14:22, aliane abdelouahab <alabdeloua...@gmail.com> wrote:
> >> >> > > hi
> >> >> > > i just discovered the [locale][1] module in Python, and i've tried to
> >> >> > > use it with Tornado Template but i get a bizarre bizarre rendering, so
> >> >> > > 1000 will become 1 000, so i cant get the good separator, i tried
> >> >> > > both: the comma (system default) and the space (french)
> >> >> > > here is the code: