Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
5700 Näkymät

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
Hylkää
Tekijä

it shows invalid syntax error on .20*@tw

use it without @

just 0.20*tw

its working

Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
syysk. 19
4252
0
huhtik. 24
2191
4
marrask. 23
6384
0
lokak. 23
2102
0
jouluk. 22
2928