Results 1 to 8 of 8

Thread: Decimal Point\Number Question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2002
    Location
    UK
    Posts
    130

    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

  2. #2
    Hyperactive Member Dmitri K's Avatar
    Join Date
    Sep 2002
    Location
    West Palm Beach, FL
    Posts
    444
    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.

  3. #3
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    "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

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2002
    Location
    UK
    Posts
    130
    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.
    PJ

  5. #5
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    well, then use the "format" function as both dmitri and I have said !

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jan 2002
    Location
    UK
    Posts
    130
    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:
    1. Dim LINES as Double
    2. Dim TOTAL as Double
    3.  
    4. Private Sub txtlines_Change()
    5. LINES = txtlines.Text
    6.  
    7. If cmoperms.Text = "10p" Then
    8. TOTAL = Round(CDbl(("0.10")) * LINES, 2)
    9. End If
    10.  
    11. txttotal.Text = TOTAL
    12. End Sub
    PJ

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jan 2002
    Location
    UK
    Posts
    130
    Format hasnt worked for me so far, so its not in there now....
    PJ

  8. #8
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    VB Code:
    1. Dim LINES as Double
    2. Dim TOTAL as Double
    3.  
    4. Private Sub txtlines_Change()
    5.  
    6. LINES = Cdbl(txtlines.Text)
    7.  
    8. If cmoperms.Text = "10p" Then
    9.  
    10. TOTAL = Round(CDbl(("0.10")) * LINES, 2)
    11.  
    12. End If
    13.  
    14. txttotal.Text = FormatNumber(TOTAL,2)
    15.  
    16. 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
  •  



Click Here to Expand Forum to Full Width