تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
5465 أدوات العرض

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
سبتمبر 19
4084
0
أبريل 24
1973
4
نوفمبر 23
6085
0
أكتوبر 23
1824
0
ديسمبر 22
2728