In my database I have a field I wan to use for storing credits. Credits are in multiples of 0.5
, so for example a person can have 1, 1.5 10 or 100 etc
Have I chosen the right field in the database for this?....
models.DecimalField(max_digits=10, decimal_places=5,
null=True, blank=True)
Also on showing the balance I do the following....
def _balance(self):
aggregates = self.transactions.aggregate(sum=Sum('amount'))
sum = aggregates['sum']
return D('0') if sum is None else sum
Which gives me for example 10.00000 which is not what I want. I would like 10 or if it had half 10.5 etc.