Comma as a decimal separator

2009-01-27 Thread Fabio Natali

Hi everybody there! :-)

I have a decimal field and I wish I could use a comma as a separator
between the integer and the decimal part (according to my country
habit).

How do you think I can manage that?

I found this snippet [0], which seems promising. The thing is, I need
to use that field in my admin backend and I don't know how to
integrate that snippet in my admin.

Here comes a stripped-down version of my models.py:

###
class Product(models.Model):
name = models.CharField(max_length=30)
value = models.DecimalField(max_digits=10, decimal_places=2, default="0.00")

class ProductAdmin(admin.ModelAdmin):
list_display = ('name','value')

admin.site.register(Product, ProductAdmin)
###

Thanks for your help,
cheers,
Fabio.

[0] http://www.djangosnippets.org/snippets/643/

-- 
Fabio Natali

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Decimal separator

2008-01-31 Thread Ramiro Morales

Mauro,

On Jan 31, 2008 10:23 AM, Mauro Sánchez <[EMAIL PROTECTED]> wrote:
>
> Hello.
> How can I establish the comma ',' as the decimal separator?
> Is there any config file where I should set it up?
> Thanks.

You can try with the decimalfmt filter of Christopher Lenz's [1]Babel
[2]Django plugin that
includes template filters and a context processor.

You can find additional information at:

  http://www.cmlenz.net/archives/2007/09/djangobabel-integration#more

Regards,

-- 
 Ramiro Morales

1. http://babel.edgewall.org/
2. http://babel.edgewall.org/wiki/BabelDjango

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Decimal separator

2008-01-31 Thread Ariel Calzada

Mauro Sánchez wrote:
> Hello.
> How can I establish the comma ',' as the decimal separator?
> Is there any config file where I should set it up?
> Thanks.
> Mauro.
>
> >
>
>   
You should look at the locale configuration

ARIEL

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Decimal separator

2008-01-31 Thread Mauro Sánchez

Hello.
How can I establish the comma ',' as the decimal separator?
Is there any config file where I should set it up?
Thanks.
Mauro.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to display the euro currency EURO and choose the comma as the decimal separator

2007-11-27 Thread Song.qk

It does not work. I have this error message:
"UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position
0: unexpected code byte"
Which is due to the small u. Without the u as I said earlier, it does
not work as well.

On 27 nov, 21:44, David Reynolds <[EMAIL PROTECTED]> wrote:
> How about:
>
> CURRENCY = u'EURO'
>
> ?
>
> That's what we had to do to get the pound sign working.
>
> Thanks,
>
> David
>
> On 27 Nov 2007, at 1:39 pm, Song.qk wrote:
>
>
>
>
>
> > I am just using the basic Satchmo templates WITHOUT ANY
> > modifications.
>
> > On Nov 27, 8:04 pm, "Horst Gutmann" <[EMAIL PROTECTED]> wrote:
> >> First of all: How do you render your prices in the first place?
>
> >> Regards, Horst
>
> >> On Nov 27, 2007 8:18 AM, Song.qk <[EMAIL PROTECTED]> wrote:
>
> >>> Hello world,
>
> >>> I've tried many things with no avail to make appear the Euro symbol.
> >>> I've put the line
> >>> # encoding: utf-8
> >>> at the beginning of the local_settings.py and added
>
> >>> CURRENCY = 'EURO'
>
> >>> But that does not seem to work, my product prices are still  
> >>> displayed
> >>> with the $ symbol.
>
> >>> On the other hand I have two other questions:
> >>> 1- how to establish the comma ',' as the decimal separator ?
> >>> 2- how to display the symbol on the right instead of the left as  
> >>> it is
> >>> usual in Europe?
>
> >>> Thanks.
>
> >>> Quentin
>
> --
> David Reynolds
> [EMAIL PROTECTED]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to display the euro currency EURO and choose the comma as the decimal separator

2007-11-27 Thread David Reynolds

How about:

CURRENCY = u'€'

?

That's what we had to do to get the pound sign working.

Thanks,

David


On 27 Nov 2007, at 1:39 pm, Song.qk wrote:

>
> I am just using the basic Satchmo templates WITHOUT ANY
> modifications.
>
> On Nov 27, 8:04 pm, "Horst Gutmann" <[EMAIL PROTECTED]> wrote:
>> First of all: How do you render your prices in the first place?
>>
>> Regards, Horst
>>
>> On Nov 27, 2007 8:18 AM, Song.qk <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>> Hello world,
>>
>>> I've tried many things with no avail to make appear the Euro symbol.
>>> I've put the line
>>> # encoding: utf-8
>>> at the beginning of the local_settings.py and added
>>
>>> CURRENCY = 'EURO'
>>
>>> But that does not seem to work, my product prices are still  
>>> displayed
>>> with the $ symbol.
>>
>>> On the other hand I have two other questions:
>>> 1- how to establish the comma ',' as the decimal separator ?
>>> 2- how to display the symbol on the right instead of the left as  
>>> it is
>>> usual in Europe?
>>
>>> Thanks.
>>
>>> Quentin
> >

-- 
David Reynolds
[EMAIL PROTECTED]



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to display the euro currency EURO and choose the comma as the decimal separator

2007-11-27 Thread Song.qk

I am just using the basic Satchmo templates WITHOUT ANY
modifications.

On Nov 27, 8:04 pm, "Horst Gutmann" <[EMAIL PROTECTED]> wrote:
> First of all: How do you render your prices in the first place?
>
> Regards, Horst
>
> On Nov 27, 2007 8:18 AM, Song.qk <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello world,
>
> > I've tried many things with no avail to make appear the Euro symbol.
> > I've put the line
> > # encoding: utf-8
> > at the beginning of the local_settings.py and added
>
> > CURRENCY = 'EURO'
>
> > But that does not seem to work, my product prices are still displayed
> > with the $ symbol.
>
> > On the other hand I have two other questions:
> > 1- how to establish the comma ',' as the decimal separator ?
> > 2- how to display the symbol on the right instead of the left as it is
> > usual in Europe?
>
> > Thanks.
>
> > Quentin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to display the euro currency EURO and choose the comma as the decimal separator

2007-11-27 Thread Horst Gutmann

First of all: How do you render your prices in the first place?

Regards, Horst

On Nov 27, 2007 8:18 AM, Song.qk <[EMAIL PROTECTED]> wrote:
>
> Hello world,
>
> I've tried many things with no avail to make appear the Euro symbol.
> I've put the line
> # encoding: utf-8
> at the beginning of the local_settings.py and added
>
> CURRENCY = 'EURO'
>
> But that does not seem to work, my product prices are still displayed
> with the $ symbol.
>
> On the other hand I have two other questions:
> 1- how to establish the comma ',' as the decimal separator ?
> 2- how to display the symbol on the right instead of the left as it is
> usual in Europe?
>
> Thanks.
>
> Quentin
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---