On 3/05/2012 2:30pm, orschiro wrote:
Anybody?
On May 2, 11:07 am, orschiro<orsch...@googlemail.com> wrote:
I want to represent a price in my model in the form of 0,00. This is
the part of my model.
price = models.DecimalField(max_digits=5, decimal_places=2,
default=Decimal('0.00'))
However, prices such as 2.10 are still represented as 2.1.
The second issue would be to replace the . with a ,. However
default=Decimal('0,00') of course is not possible since , is not a
valid literal for Decimal.
Any ideas?
Never tried this but I certainly want to eventually. So in settings.py
at the least you would need ...
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True
https://docs.djangoproject.com/en/1.4/topics/i18n/
If you figure out the neatest way for different users in different
places to switch locales I would like to hear how it is done.
Cheers
Mike
--
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.