|
Subject:
|
vb 2005 Tip Calculating program
|
|
Posted By:
|
nym11
|
Post Date:
|
9/28/2006 3:56:48 PM
|
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
|
|
Reply By:
|
BrianWren
|
Reply Date:
|
9/28/2006 5:26:45 PM
|
This worked for me: Dim s, t As String
t = (22 * 50.358).ToString
s = Format(Val(t), "0,0.00")
|