Wrox Programmer Forums
|
Visual Studio 2008 For discussing Visual Studio 2008. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2008 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 24th, 2009, 07:54 AM
Registered User
 
Join Date: Nov 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB

Hi,
i created a vb form and i want to compute the timein and timeout in minutes
in the txtbox the amount that customer needs to pay:

Example: time in = 2.00am and timeout= 3.30am the result should give me the total amount of entering the two time
total amount= ?????
i did as following bt i couldn't get it:

Dim n1, n2, total As Integer
n1 = CInt(txtnum1.Text)
n2 = CInt(txtnum2.Text)
If n1 + n2 > 60 Then
total = (n1 + n2) * 60
ElseIf n1 + n2 < 60 Then
total = (n1 + n2) * 60
End If
txttotal.Text = total



i really need ur help...can u plz help me

Last edited by miss87; November 24th, 2009 at 11:37 AM..
 
Old November 24th, 2009, 09:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

We solve a similar things a couple of days ago.

You need to do the math in minutes!!! Cint will not transform the time to minutes. Inspect the class datetime to realize what you need. Transform every time to minutes and then do the maths.
Also take care that maybe you change the day in the middle, so the work around is to add the difference between them (to avoid a minus sign).
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old November 24th, 2009, 11:34 AM
Registered User
 
Join Date: Nov 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

so how can i solve it coz really i have no idea in vb





Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a VB 2005 exe file on a system without VB dilionyi Pro Visual Basic 2005 3 September 21st, 2009 07:37 PM
VB.NET 2003 Appendix B convert to VB 2008 Express Edition brucechess BOOK: Beginning VB.NET Databases 10 February 5th, 2009 12:52 PM
Converting the DTS file execution from vb to vb . ankur.nagdeve .NET Framework 2.0 0 February 27th, 2008 05:12 AM
convert dsr file from vb to vb.net Shashi001 VB Components 1 September 22nd, 2006 12:24 PM
converting DTS package from VB 6 to VB .NET petroleo Pro VB Databases 0 August 18th, 2003 05:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.