Good night friends!
I'm having trouble making a multiplication between two variables where the result output is "NaN".
When I do the multiplication using the operand as the input payload and multiply it by a global variable, it works.
Below is my flow with the result "NaN":
[{"id":"dae1fa58.ce9168","type":"ui_template","z":"6e917fb5.ac771","group":"6f658e33.ccd82","name":"Total R$","order":1,"width":0,"height":0,"format":"<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":700,"y":200,"wires":[["a24447fb.42a658"]]},{"id":"1b51bd6c.6b1273","type":"function","z":"6e917fb5.ac771","name":"","func":"var conv = msg.payload[0];\nvar dolar = flow.get(\"usdt\");\nvar total = conv*dolar;\n\nmsg.payload = 'R$ '+total;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":560,"y":200,"wires":[["dae1fa58.ce9168"]]},{"id":"22a1b4a.ffdfa4c","type":"http request","z":"6e917fb5.ac771","name":"USDT","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://www.infomoney.com.br/cotacoes/tether-usdt/","tls":"","persist":false,"proxy":"","authType":"","x":270,"y":200,"wires":[["adffe6f0.7f85f8"]]},{"id":"d7c3558c.b91758","type":"inject","z":"6e917fb5.ac771","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":200,"wires":[["22a1b4a.ffdfa4c"]]},{"id":"adffe6f0.7f85f8","type":"html","z":"6e917fb5.ac771","name":"total","property":"payload","outproperty":"payload","tag":"div.value>p","ret":"html","as":"single","x":420,"y":200,"wires":[["95966ffb.5c222","a24447fb.42a658","1b51bd6c.6b1273"]]},{"id":"a24447fb.42a658","type":"debug","z":"6e917fb5.ac771","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":870,"y":160,"wires":[]},{"id":"6f658e33.ccd82","type":"ui_group","z":"","name":"Saldo em Reais","tab":"5fb77a02.18daa4","order":3,"disp":true,"width":"6","collapse":false},{"id":"5fb77a02.18daa4","type":"ui_tab","z":"","name":"Demo - CCM","icon":"visibility","disabled":false,"hidden":false}]
Here is the test done using the node input:
[{"id":"c47b3966.e36868","type":"ui_template","z":"6e917fb5.ac771","group":"6f658e33.ccd82","name":"Total R$","order":1,"width":0,"height":0,"format":"<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":680,"y":340,"wires":[["5a192a65.78aca4"]]},{"id":"5a192a65.78aca4","type":"debug","z":"6e917fb5.ac771","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":850,"y":320,"wires":[]},{"id":"de12327.f91cdd","type":"function","z":"6e917fb5.ac771","name":"","func":"var conv = msg.payload;\nvar dolar = flow.get(\"usdt\");\nvar total = conv*dolar;\n\nmsg.payload = 'R$ '+total;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":520,"y":340,"wires":[["c47b3966.e36868"]]},{"id":"f247e14c.1c70a","type":"inject","z":"6e917fb5.ac771","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"3","payloadType":"str","x":310,"y":340,"wires":[["de12327.f91cdd"]]},{"id":"6f658e33.ccd82","type":"ui_group","z":"","name":"Saldo em Reais","tab":"5fb77a02.18daa4","order":3,"disp":true,"width":"6","collapse":false},{"id":"5fb77a02.18daa4","type":"ui_tab","z":"","name":"Demo - CCM","icon":"visibility","disabled":false,"hidden":false}]
I thank you for your attention and help from the Friends!