|
-
Oct 10th, 2002, 01:56 AM
#1
Thread Starter
Member
help with format function??? quick!
I'm just learning VB.NET, and I'm having some trouble. I have to create a "Time Calculator" in which a number is entered into a text box, and then when you click on a button, it converts that number into the number of minutes and seconds. Say I enter 125, I need the minutes box to show 2, and the seconds box to show 5. I can only get it to show 2.000323 (etc). Is this a format function? Now say I can get the minutes label to only display 2, now how to I get the seconds to display the remaining 5??? Please help asap. Thank you!!!
-
Oct 10th, 2002, 12:15 PM
#2
Hyperactive Member
cint(125/60) will return 2 as an integer can't have decimal places.
125 mod 60 will return 5 as the remainder of the division of 125 by 60
-
Oct 10th, 2002, 12:20 PM
#3
New Member
intMinutes = cint(125/60)
intSeconds = 125 -(60*2)
-
Oct 10th, 2002, 06:07 PM
#4
Addicted Member
Originally posted by Dog_Gone
intMinutes = cint(125/60)
intSeconds = 125 -(60*2)
actually i think intSeconds should be this: intSeconds = 125 - (60*intMinutes)
Jeremy
-
Oct 11th, 2002, 02:21 AM
#5
Addicted Member
intminutes = cint(125/60)
intseconds = cint(125/60) mod 60
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|