|
-
Goldfish
Rounding numbers in VB6
Hello. I'm having trouble with a program that I have to write for my computer concepts class that's due next month, when we actually cover VB. I'm not asking anyone to do my homework for me, since I've got everything I need done. The program does what it's supposed to do, but I can't figure out how to make the currency display in the textbox with only 2 numbers after the decimal instead of 4. Anyone have a good idea on how to do this?
Here's what I have which is working fine:
Code:
Private Sub cmdCalculate_Click()
Dim cBillAmt@, cTipAmt@
Dim sPercent!
cBillAmt@ = CCur(txtAmount.Text)
sPercent! = CSng(txtPercentage.Text)
cTipAmt@ = cBillAmt@ * sPercent!
txtTipAmt.Text = "$" & CStr(cTipAmt@)
End Sub
Thanks in advance.
-Daft
Last edited by daftness101; 07-04-2002 at 03:24 PM.
-
-
Catfish
help->index search for "format" ??
-
Goldfish
Thanks for the help
Thanks guys. I'll look that up. I wish the book I'm reading would've covered that when it covered the different data types. Oh well, nothing's perfect. Thanks again.
-Daft
-
Goldfish
Can't search the index...no help in WM edition
Well, I guess it would help if I had something other than the Working Model Edition. I just tried checking it out and it's telling me there's no help in the Working Model Edition. Well, no one ever said Microsoft was a user-friendly company. Oh well, I'll just wait until Monday when I have class to look it up. Thanks.
-Daft
-
Catfish
everyone has access to msdn.microsoft.com
search for the format command, its very flexible.
vb6 online documentation
http://msdn.microsoft.com/library/de...bstartpage.htm
vb6 format command
http://msdn.microsoft.com/library/en...afctFormat.asp
-
Goldfish
Thanks for the links df, I'm checking them out right now. I need to remember that there's MSDN...I just don't like searching MSDN, but that's just me.
-Daft
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
|
|