Saturday, February 4, 2012

problem with localization

Hello,
i've a problem with number format localization. This is an example of
my model and admin:

MODEL
------------
class Procedure(models.Model):
....
total_income = models.DecimalField (
default = 0,
max_digits = 11,
decimal_places = 4,
verbose_name = _("Total Income"),
)
total_fee = models.DecimalField (
default = 0,
max_digits = 11,
decimal_places = 4,
verbose_name = _("Total Fee"),
)
....
def total(self):
return self.total_income + self.total_fee

ADMIN
-----------
class ProcedureAdmin(dmin.ModelAdmin):
list_display = (..., 'total_income', 'total_fee', 'total', ...)

output is:

... | 35,22 | 9,28 | 45.50 | ...

with comma in first two cases and dot then.
How can I do?
Thanks in advance,
Vittorino

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment