Results 1 to 3 of 3

Thread: [RESOLVED] number format

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Location
    Madrid
    Posts
    325

    Resolved [RESOLVED] number format

    Hi,

    I want to use a diferent number format. I want to keep the zeros in front of a number, for instance:

    00,01,02,03,04,05,06,....09,10,11

    I know I could use a conditional if, if number less than 10, then "0" + number.

    Is there another way of doing this?

    Using sth like, I´ve tried many things but no luck.

    Dim sno As String
    Dim num As Integer
    num = 1
    txtsno.Text = num.ToString("##")

  2. #2
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: number format

    How about using
    VB Code:
    1. num.ToString("0#")
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Location
    Madrid
    Posts
    325

    Re: number format

    very nice!
    cheers!

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