I have a model in which I use Django ORM to extract Avg of values from the table. I want to Round that Avg value, how do I do this?
See below I am extracting Avg pri
Improving on @mrts answer.
This allows the round function to be parameterised:
class Round(Func): function = 'ROUND' arity = 2 Book.objects.all().aggregate(Round(Avg('price'), 2))