Labels

Wednesday, March 18, 2015

Floor Function In Loadrunner

My collegue came across a situtation where he needed to convert a correlated value to floor. Any value with fractional part greater than .5 should be converted to next nearest integer. However, the valueswith fractional part less than .5 were normally getting converted to nearest lower interger.
e.g.
4.2=4
4.6=5
We came up to a solution that works in this case

double inputval =  4.454567878E8;
> double result = floor(inputval + 0.5);