Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Visual Logic (Mod) Numbers


  • Please log in to reply

#1
bdaking

bdaking

    New Member

  • Member
  • Pip
  • 1 posts
Hey all,
Just wondering how exactly you go about modding numbers in visual logic. I have a variable holding an input of a number. I want to basically divide this by 1000 to find out how many times 1000 goes into the number but i also need to Mod the variable to find the left over amount after the thousand has gone into this. i tried to do

Variable name = Thousand. then the assignment box (Variable name holding initial input)- NumberNeeded Mod(1000)
its the mod part im having problems with. How should i be modding it as i must be doing it incorrectly.
Thanks
  • 0

Advertisements


#2
Ax238

Ax238

    Tech Staff

  • Technician
  • 1,323 posts
Hello bdaking and welcome to GTG,

You're on the right track, let me give you a bit of direction. I didn't completely follow what you posted, but I'll show you an example of using the VB modulus function:

Suppose the initial number is 54100, we'll give it a variable name of Numerator. To get the Mod value (ModVal) using a denominator of 1000, we'd do the following:
ModVal = Numerator Mod 1000
This will divide 54100 by 1000 and return the remainder. ModVal should now have a value of 100.

That's it! Hope it helps.

Ax

Edited by Ax238, 14 November 2007 - 04:16 PM.

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP