콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
5452 화면

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
4082
0
4월 24
1971
4
11월 23
6082
0
10월 23
1821
0
12월 22
2725