Share Calculation – example of mathematical calculation in LoadRunner

Example script showing mathematical calculations. This script converts text values into decimal values so that they can be used in calculations. The script performs a calculation using a decimal number [484.05253284] where it has not been possible to capture that number as a single value. In this case 484 and 05253284 are captured by another function (web_reg_save_param) The decimal point was the delimiter allowing the two values to be captured. This function was used in an HSDL script to calculate the number of shares that could be purchased with a certain amount of money.

In the script attached to this post, the number of shares worth 484.05253284p that can be purchased with a fund of £1380 is returned.

 

2016-10-06-16_11_59-start

Author: Richard Bishop

http://about.me/richard_bishop