thy_   164 Posted January 26, 2023 Is there a way to skip a conditional to avoid negative numbers?  _balance expected: _A = 20; _B = 10; _balance = _A - _B; // results 10 _balance reality: 😅 _A = 20; _B = 60; _balance = _A - _B; // results -40 A lazy solution: _A = 20; _B = 60; _balance = 0; if ( _A > _B ) then { _balance = _A - _B } else { _balance = _B - _A }; // results 40 always  Show me what you got...  Share this post Link to post Share on other sites
thy_   164 Posted January 26, 2023 https://community.bistudio.com/wiki/abs  _A = 20; _B = 60; _balance = abs (_A - _B); // results always 40 (positive)  1 Share this post Link to post Share on other sites