Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 20990

How to round a decimal value when working with context.expand number values?

$
0
0

I'm to verify values of an equation that is happening on the back end.

Example Values:
wages = 29250
divby = 11670
Should Equal = 2.5064267352 //which it does

 

QUESTION:  I need the result value I"m asserting is to = 2.51

 

def testValuea = context.expand( '${Properties#a}' ) as int //--11670
def testValueb = context.expand( '${Properties#b}' ) as int //--29250

 

result = (testValueb / testValuea)*100

//now my value is 250.64267352

 

QUESTION:  How do I get this to round to (3)?
Not sure where to use .Round(3) or if to use something else.

 

Thank you,
Rob

 

 


Viewing all articles
Browse latest Browse all 20990

Trending Articles