Re: negative float

2016-05-12 Thread Григор Колев
I found the error. coef is taken from another database The two fields are the same but when I record value in the new database is not recorded properly. this is the solution but no sense. The fields in both databases are identical. I just copy from one database and paste the value in the other

Re: negative float

2016-05-12 Thread Sergiy Khohlov
Hard to help with this small code. Could you please send me all function or class from your view.py ? 12 трав. 2016 22:37 "Григор Колев" пише: > #models.py > coef = models.DecimalField(max_digits=5, decimal_places=4, default=0.0100, > verbose_name='Коефицент') > > > #view.py > item['coef'] == 0.0

negative float

2016-05-12 Thread Григор Колев
#models.py coef = models.DecimalField(max_digits=5, decimal_places=4, default=0.0100, verbose_name='Коефицент') #view.py item['coef'] == 0.01 print item['coef'] # return 0.0 if item['total'] < 0: item['sum'] = item['total'] * ( item['coef'] * -1) On Python it is work. I try to make coke Flo