Monetary amount input

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

See Locale aware input in forms

1 Like

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

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