Results 1 to 17 of 17

Thread: RESOLVED ** Format - does not work

  1. #1

    Thread Starter
    Fanatic Member holly's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere on earth
    Posts
    721

    RESOLVED ** Format - does not work

    Hi

    Why will this statement not format the users input....
    VB Code:
    1. txtinformation = Format$(txtinformation.Text, "####.00")

    Thanks

    For ex:
    a user inputs a value i.e 12345 but I need the format function
    to take this number and format it accordingly so txtinformation
    would read i.e 1234.5...

    Thanks

    Last edited by holly; Oct 15th, 2003 at 07:14 AM.
    ** HOLLY **

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    If you read up on the Format function, you'll see that's not exactly how it works, but try this...
    VB Code:
    1. Format$("12345", "@@@@.")
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Or this...

    VB Code:
    1. txtInformation.Text = Left$(txtInformation.Text, Len(txtInformation.Text) - 2) & "." & Mid$(txtInformation.Text, Len(txtInformation.Text) - 1)
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  4. #4

    Thread Starter
    Fanatic Member holly's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere on earth
    Posts
    721
    Thanks

    Both examples work a treat......

    Thanks
    ** HOLLY **

  5. #5
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    Or use the masked edit box (with a mask of ####.# ) instead of the normal text box.
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  6. #6
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Holly, you're fond of the 'ol winking aren't ya
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  7. #7

    Thread Starter
    Fanatic Member holly's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere on earth
    Posts
    721
    Originally posted by plenderj
    Holly, you're fond of the 'ol winking aren't ya
    Yes!! I liked to be winked at!!
    ** HOLLY **

  8. #8
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Originally posted by holly
    Yes!! I liked to be winked at!!
    Oh do you indeed
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  9. #9

    Thread Starter
    Fanatic Member holly's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere on earth
    Posts
    721
    YES!!
    ** HOLLY **

  10. #10
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    So how's sunny manchester à la mer this time of year then ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  11. #11

    Thread Starter
    Fanatic Member holly's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere on earth
    Posts
    721
    Its Not too bad - When does the sun ever shine on Manchester?
    rain now thats a different matter!! How's sunny Ireland? or
    is Ireland as bad as Manchester?

    ** HOLLY **

  12. #12
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Ireland, the most beautiful country that ever was, being compared to Manchester?
    Not to say anything against Manchester, but I'm offended
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  13. #13

    Thread Starter
    Fanatic Member holly's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere on earth
    Posts
    721
    Originally posted by plenderj
    Ireland, the most beautiful country that ever was, being compared to Manchester?
    Not to say anything against Manchester, but I'm offended
    Whats wrong with comparing Ireland to Manchester? Whats
    wrong with Manchester?????

    I was not comparing manchester to ireland, i was merely interested in the weather? I've heard it rains alot........
    ** HOLLY **

  14. #14
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    *mutters to self*
    Yeah it does have a habit of raining from time to time. Suppose its something to do with us protecting you from the Atlantic
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  15. #15

    Thread Starter
    Fanatic Member holly's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere on earth
    Posts
    721
    Slap myself....
    How could I forget! Well atleast Ireland is good for
    something!!!

    ** HOLLY **

  16. #16
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Originally posted by holly
    Slap myself....
    How could I forget! Well atleast Ireland is good for
    something!!!

    *jamie ponders what britain's there for ....*

    Hmmmm. Can't think of anything
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  17. #17

    Thread Starter
    Fanatic Member holly's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere on earth
    Posts
    721
    I'll leave that one with you....Its time to go home.... Nice
    talking to you..... (plenty winks)
    ** HOLLY **

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