djangosnippets.org: Latest snippets posted by alexpirinehttps://djangosnippets.org/users/alexpirine/2016-02-08T07:39:25.735738-06:00alexpirineAutomatically round Django's DecimalField according to the max_digits and decimal_places attributes
2016-02-08T07:39:25.735738-06:00alexpirinehttps://djangosnippets.org/snippets/10554/<p>This snippet allows you to use a new field type, RoundedDecimalField, that will automatically round any value affected to it according to the max_digits and decimal_places attributes. You will no longer receive validation errors if you use a float or a decimal with too many decimal digits.</p>
Freely redistributable