Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

simple numerical calculation with variables -need help-

View previous topic View next topic Go down

simple numerical calculation with variables -need help-

Post by Techniker on Tue Jan 24, 2012 1:10 am

Hello to everyone.


First, I`m glad that I found this forum. Since a few days i try to make some simple numerical calculations with variables.


For example:


store 10 x

store 5 y

store eval storedVars['x']-storedVars['y'] Z

echo ${Z}


then, I recieve a error in the log: NaN.


Could anybody give me an example for a numerical calculation please.


Best wishes fom the northern part of germany.


Techniker

Techniker

Posts : 3
Join date : 2012-01-24

Back to top Go down

Re: simple numerical calculation with variables -need help-

Post by Techniker on Tue Jan 24, 2012 5:12 pm

I found the solution myself.

StoreEval javascript{storedVars['x']-storedVars['y']} Z

And the NaN occours only because I didn`t got the value from the html

Techniker

Posts : 3
Join date : 2012-01-24

Back to top Go down

Re: simple numerical calculation with variables -need help-

Post by rohit13 on Thu Apr 12, 2012 6:54 pm

Use below code, change operator as per your requirements

Code:
store  |10 | x

store  | 5  | y

storeEval | ${x}+${y} |    Z

echo  | ${Z}

_________________
Radical QA
http://radical-qa.blogspot.in/

rohit13
Master
Master

Posts : 180
Join date : 2012-03-29
Age : 30
Location : INDIA

http://radical-qa.blogspot.in/

Back to top Go down

Re: simple numerical calculation with variables -need help-

Post by vlady_1027 on Tue Jun 05, 2012 8:46 pm

rohit13 wrote:Use below code, change operator as per your requirements

Code:
store |10 | x

store | 5 | y

storeEval | ${x}+${y} | Z

echo | ${Z}



Hello,

Store | 10 | x

Store | 5.99 |y

storeEval | ${x}*${y} | Z

echo | ${Z}

I get Z = 59.900000000000006

Could you tell me how can I get Z to be equal 59.90?



Thanks!

vlady_1027

Posts : 1
Join date : 2012-05-12

Back to top Go down

Re: simple numerical calculation with variables -need help-

Post by kashyap_guru on Fri Oct 18, 2013 1:05 pm

Here is your answer vlady_1027...

Store | 10 | x

Store | 5.99 |y

storeEval | ${x}*${y} | Z


storeEval | javascript:{${Z}.toFixed(2)} | Z

kashyap_guru
Active particpant
Active particpant

Posts : 24
Join date : 2013-10-16
Age : 29
Location : India

Back to top Go down

Re: simple numerical calculation with variables -need help-

Post by Sponsored content Today at 5:11 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum