|
-
Nov 3rd, 2002, 01:43 PM
#1
Thread Starter
Addicted Member
Decimal Point\Number Question
At the moment I am getting results in a text box coming up as 0.1 when they should read 0.10
I know I havent given much information here but can you give me an answer just from that?
Last edited by gneville16; Nov 3rd, 2002 at 01:52 PM.
PJ
-
Nov 3rd, 2002, 01:53 PM
#2
Hyperactive Member
use Format function, i know I haven't given much but maybe you can get the answer just from that 
Hint: Text1 = Format(Text1, "0.00"). If text1 had "0.1", it will have "0.10" after the code.
-
Nov 3rd, 2002, 01:55 PM
#3
PowerPoster
"should" according to whom? Mathematically, they are identical, so I assume you're just looking for help with the cosmetics. Try "format" in the on-line help
-
Nov 3rd, 2002, 02:08 PM
#4
Thread Starter
Addicted Member
According to me. If one of my customers see 0.1 they will assume they are only paying 1p when really its 10p. I know for 1p it would be 0.01 but I would really like to know how to get 0.10 to ease any confusion. Im no good with VB so dont have a clue.
-
Nov 3rd, 2002, 04:14 PM
#5
PowerPoster
well, then use the "format" function as both dmitri and I have said !
-
Nov 3rd, 2002, 04:16 PM
#6
Thread Starter
Addicted Member
Doesnt work for me, and Ive tried all suggestions from someone on here who is a VB genius too.
here is my code if you can help.
VB Code:
Dim LINES as Double
Dim TOTAL as Double
Private Sub txtlines_Change()
LINES = txtlines.Text
If cmoperms.Text = "10p" Then
TOTAL = Round(CDbl(("0.10")) * LINES, 2)
End If
txttotal.Text = TOTAL
End Sub
-
Nov 3rd, 2002, 04:17 PM
#7
Thread Starter
Addicted Member
Format hasnt worked for me so far, so its not in there now....
-
Nov 3rd, 2002, 04:23 PM
#8
PowerPoster
Well
VB Code:
Dim LINES as Double
Dim TOTAL as Double
Private Sub txtlines_Change()
LINES = Cdbl(txtlines.Text)
If cmoperms.Text = "10p" Then
TOTAL = Round(CDbl(("0.10")) * LINES, 2)
End If
txttotal.Text = FormatNumber(TOTAL,2)
End Sub
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
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
|