Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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