Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
5468 Zobrazení

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
Zrušit
Autor

it shows invalid syntax error on .20*@tw

use it without @

just 0.20*tw

its working

Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
zář 19
4085
0
dub 24
1975
4
lis 23
6089
0
říj 23
1826
0
pro 22
2731