 warren_scott
		
		
		
		
		
		
		
		
	
			 on 
    
	
		
		
		10-05-2011
	
		
		03:42 PM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
		
	
				
		
			7 Comments (7 New)
		
			warren_scott
		
		
		
		
		
		
		
		
	
			 on 
    
	
		
		
		10-05-2011
	
		
		03:42 PM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
		
	
				
		
			7 Comments (7 New)
		
	
		I have a bunch of times that I need to round a numeric variable in TestStand
example: Locals.A = round(Locals.B)
However, it's actually more complicated than that because I need to round it at the Nth position after the decimal point (for example). This means my expression becomes something like Locals.A = pow(10,-Locals.Digits) * round (Locals.A * pow(10,Locals.Digits) ) (for Locals.Digits == 3, this means that Locals=A becomes 0.123 when Locals.B is 0.1234)
This is a lot more code than I really want to write. If I am doing the same thing in MS Excel, I just say $B5 = round($B4,$A$1) or something like that. Notice how the digits of precision to round to is built into the round function. I'd love if TestStand round function could be expanded the same way
Round(Number, [option], [Digits])
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.