Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics 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 September 28th, 2006, 03:56 PM
Registered User
 
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default vb 2005 Tip Calculating program

 Dim bill, percentage, tip As String
        bill = txtbill.Text
        percentage = txtpercent.Text



        tip = bill * percentage / 100
        txttip.Text = tip

this is my code and i need the answer to round to the hundreths place as money would. something to the effect of math.round(tip, 2) but i dont know where to add that code and when i add it in certain places it doesnt fix anything and somtimes makes the output 0. please helppppppppp! thanks

 
Old September 28th, 2006, 05:26 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

This worked for me:
Code:
        Dim s, t As String

        t = (22 * 50.358).ToString

        s = Format(Val(t), "0,0.00")





Similar Threads
Thread Thread Starter Forum Replies Last Post
reg conn to sql server 2005 from vb.net 2005.. veda SQL Server 2005 2 July 1st, 2008 12:16 AM
Installation Program in Visual Studio 2005 gazalec Visual Studio 2005 1 November 19th, 2007 03:14 PM
Lottery Program Help...I'm using 2005 Visual Basic psycoblaster VB.NET 2002/2003 Basics 13 May 23rd, 2007 09:13 PM
Worked on ASP 2005 but new to VB 2005 akhilhp Visual Basic 2005 Basics 0 May 18th, 2007 12:37 AM
Call VB Exe from VB Program jmss66 VB How-To 5 December 12th, 2004 11:17 AM





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