Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
i got a bad rendering in template when using locale.format
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
aliane abdelouahab  
View profile  
 More options Oct 18 2012, 9:22 am
From: aliane abdelouahab <alabdeloua...@gmail.com>
Date: Thu, 18 Oct 2012 06:22:54 -0700 (PDT)
Local: Thurs, Oct 18 2012 9:22 am
Subject: i got a bad rendering in template when using locale.format
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:

import locale
locale.setlocale(locale.LC_ALL, "french_France")

and in the template:

{% import locale %}
<span class="prix">The price: {{locale.format("%d", price,
grouping=True)}} DA</span>

any ideas?
NB: changed the font and always the same bizarre that is showing.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aliane abdelouahab  
View profile  
 More options Oct 18 2012, 9:40 am
From: aliane abdelouahab <alabdeloua...@gmail.com>
Date: Thu, 18 Oct 2012 06:40:55 -0700 (PDT)
Local: Thurs, Oct 18 2012 9:40 am
Subject: Re: i got a bad rendering in template when using locale.format
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aliane abdelouahab  
View profile  
 More options Oct 18 2012, 9:45 am
From: aliane abdelouahab <alabdeloua...@gmail.com>
Date: Thu, 18 Oct 2012 06:45:52 -0700 (PDT)
Local: Thurs, Oct 18 2012 9:45 am
Subject: Re: i got a bad rendering in template when using locale.format
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aliane abdelouahab  
View profile  
 More options Oct 18 2012, 10:52 am
From: aliane abdelouahab <alabdeloua...@gmail.com>
Date: Thu, 18 Oct 2012 07:52:26 -0700 (PDT)
Local: Thurs, Oct 18 2012 10:52 am
Subject: Re: i got a bad rendering in template when using locale.format
update:
using babel.numbers worked good.
i've found this
https://groups.google.com/group/python-tornado/browse_thread/thread/b...

On 18 oct, 14:45, aliane abdelouahab <alabdeloua...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Frank Smit  
View profile  
 More options Oct 19 2012, 5:05 am
From: Frank Smit <fr...@61924.nl>
Date: Fri, 19 Oct 2012 11:05:44 +0200
Local: Fri, Oct 19 2012 5:05 am
Subject: Re: [tornado] Re: i got a bad rendering in template when using locale.format
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aliane abdelouahab  
View profile  
 More options Oct 19 2012, 10:07 am
From: aliane abdelouahab <alabdeloua...@gmail.com>
Date: Fri, 19 Oct 2012 07:07:39 -0700 (PDT)
Local: Fri, Oct 19 2012 10:07 am
Subject: Re: i got a bad rendering in template when using locale.format
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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Frank Smit  
View profile  
 More options Oct 19 2012, 11:23 am
From: Frank Smit <fr...@61924.nl>
Date: Fri, 19 Oct 2012 17:23:45 +0200
Local: Fri, Oct 19 2012 11:23 am
Subject: Re: [tornado] Re: i got a bad rendering in template when using locale.format
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aliane abdelouahab  
View profile  
 More options Oct 19 2012, 5:27 pm
From: aliane abdelouahab <alabdeloua...@gmail.com>
Date: Fri, 19 Oct 2012 14:27:16 -0700 (PDT)
Local: Fri, Oct 19 2012 5:27 pm
Subject: Re: i got a bad rendering in template when using locale.format
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »