In my project I’m asking the user for some measures, prices and weights. I want to store data as a two decimal value. I guess I should be using DecimalField instead of FloatField, because I don’t need much precision.
When I print values in my templates, I don’t want zero non significant decimals to be printed.
Examples:
10.00 should show simply 10
10.05 should show 10.05
I don’t want to use floatformat filter in every template I display the value, too many places. So I was wondering if there is some way to affect the value rendered for all the application, in a centralized manner.
Thanks
I finally came up with the answer to this question and posted it in my blog:
http://tothinkornottothink.com/post/2156476872/django-positivenormalizeddecimalfield
I hope somebody finds it useful