Hojland Member H Join Date Oct 2006 Location Langå Posts 203 Mar 22, 2018 #1 Hey guys I have 2 numric inputs, from my PV, and I need to know the differens between them. I use a sub Eg 50-20 = 30 But if they input 20-50 = -30 I need it to come out in a positive value. How do I do that
Hey guys I have 2 numric inputs, from my PV, and I need to know the differens between them. I use a sub Eg 50-20 = 30 But if they input 20-50 = -30 I need it to come out in a positive value. How do I do that
BryanG Member B Join Date Feb 2005 Location Manchester Posts 1,987 Mar 22, 2018 #3 If you didn't have ABS, then: If 'this one' is bigger than or equal to 'that one' then subtract 'that one' from 'this one'. Otherwise subtract 'this one' from 'that one'.
If you didn't have ABS, then: If 'this one' is bigger than or equal to 'that one' then subtract 'that one' from 'this one'. Otherwise subtract 'this one' from 'that one'.
Steve Bailey Lifetime Supporting Member + Moderator Join Date Apr 2002 Location The boondocks of Western Massachusetts USA Posts 8,591 Mar 22, 2018 #4 If difference is less than zero multiply difference by -1.