+ Reply to Thread
Results 1 to 3 of 3

padding numeric values with 0's

  1. #1
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    padding numeric values with 0's

    I need a left side padding for numeric values to keep them in 4 digits
    ie 1 becomes 0001, 25 becomes 0025 and 345 becomes 0345. Following is the custom number format I tried and it fails. Can somebody help.

    [<10]"000"#;[<100]"00"#;[<1000]"0"#

    rgds

    johnjohns
    Last edited by johnjohns; 02-03-2010 at 09:15 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: padding numeric values with 0's

    Try just:

    0000
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: padding numeric values with 0's

    Vow! Works absolutely fine!! Thanks a million, NBVC! I spent 1 hr on R&D to get a solution and you showed me how simple it is!!

    rgds
    johnjohns

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1