Skip to Content
Menu
This question has been flagged
2 Replies
5660 Rodiniai

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.

Portretas
Atmesti
Autorius

it shows invalid syntax error on .20*@tw

use it without @

just 0.20*tw

its working

Best Answer

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


Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
rugs. 19
4227
0
bal. 24
2170
4
lapkr. 23
6356
0
spal. 23
2069
0
gruod. 22
2887