Django F() division - How to avoid rounding off
I have this code: q = MyModel.objects.order_by('-value1').annotate( res=ExpressionWrapper( (F('value1') / F('value2')), output_field=FloatField()), ) for i in q: print(i.value1, i.value2, i.res) So, the output will be: 5 10 0.0 1 2 0.0 But I need 5 10 0.5 1 2 0.5 Wy F() rounded the result? How not to do this? Thanks! The result you are expecting is really easy to achieve with a raw query and really, I mean really hard to achieve with pure django. from django.db.models import FloatField, ExpressionWrapper, F template = '%(function)s(%(expressions)s AS FLOAT)' fv1 = Func(F('value1'), function=