Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
5297 Представления

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


Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
сент. 19
3915
0
апр. 24
1728
4
нояб. 23
5741
0
окт. 23
1478
0
дек. 22
2418