Skip to main content

Search

Search

Question on VB MOD function

Comments

3 comments

  • Avatar
    John Franklin

    A little more about the  problem that I am trying to solve. The weight from the weigh scale needs to be converted to 5 digits. EG 2.5 > 02510

    I am trying to create a script to accomplish this on the OnProcessData event of the Bar code's weight sub string. Am I heading in the right direction?

    This is an internal use UPCA bar code the first 6 digits are the product code and the next 5 digits are the weight.

     

    0
  • Avatar
    adam cummick

    The MOD function is for modulo division. It returns the remainder of a number divided by another e.g. 11 mod 3 = 2.

    If you're just looking to isolate the decimal portion of your number do this:

    TestNumber = 123.456

    decimalNumber = TestNumber - int(TestNumber)

     

    1
  • Avatar
    John Franklin

    Thanks Adam :)

    0

Please sign in to leave a comment.