İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
5507 Görünümler

Hi friends,

I have a char field,which has formula for calculations (char field value is 0.17*(@tw)+0.6*(@tw-500) ).Here i need to replace @tw with some float value and do calculations and need to return float value.How to achieve this.

Thanks in advance.

Avatar
Vazgeç
Üretici

it shows invalid syntax error on .20*@tw

use it without @

just 0.20*tw

its working

En İyi Yanıt

hello vadivel

you can do it with "eval" method

def formula( self ):     
    tw=10 #your value
  return eval ('0.17*(tw)+0.6*(tw-500)')

Good Luck


Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Eyl 19
4102
0
Nis 24
1987
4
Kas 23
6100
0
Eki 23
1842
0
Ara 22
2734