コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
5651 ビュー

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.

アバター
破棄
著作者

it shows invalid syntax error on .20*@tw

use it without @

just 0.20*tw

its working

最善の回答

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


アバター
破棄
関連投稿 返信 ビュー 活動
1
9月 19
4226
0
4月 24
2170
4
11月 23
6354
0
10月 23
2065
0
12月 22
2885