number formating!

Discussion in 'ASP General' started by Jamie Fryatt, Feb 10, 2004.

  1. Jamie Fryatt

    Jamie Fryatt Guest

    I have a querystring that passes through the value 001 for example,

    the form on the receiving page need to display that number but with 1 added
    to it.

    i have

    dim strnum
    strnum = request.querystring("value")
    strnum = strnum + 1

    when displayed <%=strnum%> shows 2 instead of 002, and the zero's are very
    important, is there any number formating trick i dont know or another way of
    doing this?

    i thought about coding the first two zero's in before i call the strnum but
    this would mess things up when i get to 010 etc.

    thanks

    Jamie
    Jamie Fryatt, Feb 10, 2004
    #1
    1. Advertising

  2. <%=right("000" & strnum, 3)%>

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/




    "Jamie Fryatt" <> wrote in message
    news:c0abmj$krr$...
    > I have a querystring that passes through the value 001 for example,
    >
    > the form on the receiving page need to display that number but with 1

    added
    > to it.
    >
    > i have
    >
    > dim strnum
    > strnum = request.querystring("value")
    > strnum = strnum + 1
    >
    > when displayed <%=strnum%> shows 2 instead of 002, and the zero's are very
    > important, is there any number formating trick i dont know or another way

    of
    > doing this?
    >
    > i thought about coding the first two zero's in before i call the strnum

    but
    > this would mess things up when i get to 010 etc.
    >
    > thanks
    >
    > Jamie
    >
    >
    Aaron Bertrand [MVP], Feb 10, 2004
    #2
    1. Advertising

  3. Jamie Fryatt

    Jamie Fryatt Guest

    thanks aaron :)


    "Aaron Bertrand [MVP]" <> wrote in message
    news:#...
    > <%=right("000" & strnum, 3)%>
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > http://www.aspfaq.com/
    >
    >
    >
    >
    > "Jamie Fryatt" <> wrote in message
    > news:c0abmj$krr$...
    > > I have a querystring that passes through the value 001 for example,
    > >
    > > the form on the receiving page need to display that number but with 1

    > added
    > > to it.
    > >
    > > i have
    > >
    > > dim strnum
    > > strnum = request.querystring("value")
    > > strnum = strnum + 1
    > >
    > > when displayed <%=strnum%> shows 2 instead of 002, and the zero's are

    very
    > > important, is there any number formating trick i dont know or another

    way
    > of
    > > doing this?
    > >
    > > i thought about coding the first two zero's in before i call the strnum

    > but
    > > this would mess things up when i get to 010 etc.
    > >
    > > thanks
    > >
    > > Jamie
    > >
    > >

    >
    >
    Jamie Fryatt, Feb 10, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rodrigo guerra

    automatic code formating...

    rodrigo guerra, Jul 5, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    356
    rodrigo guerra
    Jul 5, 2003
  2. Dmitri Manushin

    Formating text

    Dmitri Manushin, Aug 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    381
    Dmitri Manushin
    Aug 14, 2003
  3. John Carnahan

    Help on date formating

    John Carnahan, Nov 19, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    312
    Alvin Bruney
    Nov 19, 2003
  4. Robocop
    Replies:
    3
    Views:
    7,062
    Sean Berry
    Feb 26, 2004
  5. Jeff

    formating number

    Jeff, Nov 9, 2006, in forum: ASP General
    Replies:
    1
    Views:
    100
    MadMike42
    Nov 10, 2006
Loading...

Share This Page