Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
5672 Vizualizări

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.

Imagine profil
Abandonează
Autor

it shows invalid syntax error on .20*@tw

use it without @

just 0.20*tw

its working

Cel mai bun răspuns

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


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
sept. 19
4234
0
apr. 24
2180
4
nov. 23
6369
0
oct. 23
2084
0
dec. 22
2903