Is there a way to do rounding or modulus?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Jerry Gilels
Newbie
Posts: 6
Joined: Tue Sep 16, 2003 2:22 pm
Contact:

Is there a way to do rounding or modulus?

Post by Jerry Gilels » Mon Oct 06, 2003 12:36 am

Is there a way to do rounding or modulus?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Oct 06, 2003 1:23 am

Use VB to do rounding and modulus

Here's a small sample you can play with:
VBSTART
VBEND

Input>Dividend,What number is being divided?
Input>Divisor,What is the divisor?
Input>Places,Round to how many positions? %CRLF%(Note:Trailing zeros are dropped off).

Let>Test=%Dividend%/%Divisor%

VBEval>Round(%Test%,%Places%),Test2
VBEval>%Dividend% Mod %Divisor%,Remainder

MessageModal>Result of dividing %Dividend% by %Divisor%%CRLF%%CRLF%Normal value is:%Test%%CRLF%%CRLF%Result when rounded to %Places% places:%CRLF%%CRLF%Rounded value is: %Test2%

MessageModal>Remainder when dividing %Dividend% by %Divisor% is: %Remainder%
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts