Is there a way to do rounding or modulus?
Moderators: Dorian (MJT support), JRL
-
- Newbie
- Posts: 6
- Joined: Tue Sep 16, 2003 2:22 pm
- Contact:
Is there a way to do rounding or modulus?
Is there a way to do rounding or modulus?
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Use VB to do rounding and modulus
Here's a small sample you can play with:
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!
Bob
A humble man and PROUD of it!