Hello,
I have to use amounts in € and £. Using
USE_THOUSAND_SEPARATOR = True
in settings.py works fine to display values with separators. But this does not apply on input fields in forms.
Does any one how to display values with thousand separators and currency, but still validate the field as a decimal?
Any help is welcome
Richard
Works for thousand separators even in form inputs. Thanks,
To add currency symbol (€, $, etc.), I guess I have to create custom format files?
Thanks Ken
RichardWoj:
To add currency symbol…
I’ve never had to handle anything like that - Maybe someone else can jump in here?
I would have a look at django-money (GitHub - django-money/django-money: Money fields for Django forms and models. ) to deal with currencies in models and forms.
1 Like
This is a good package, but unfortunately, it does not have a proper mechanism to show the thousand separator.
For example, it cannot display the following number in a form input:
1,000,000,000
and it only displays decimals (like 1.45 ). In some currencies, this method is ineffective
1 Like
bioscom
February 17, 2025, 10:31am
8
This handled it at form level, what of at Model level. if you designed your forms with forms.ModelForm and not forms.Form, how do you handle it?