Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > number formating!

Reply
Thread Tools

number formating!

 
 
Jamie Fryatt
Guest
Posts: n/a
 
      02-10-2004
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


 
Reply With Quote
 
 
 
 
Aaron Bertrand [MVP]
Guest
Posts: n/a
 
      02-10-2004
<%=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
>
>



 
Reply With Quote
 
 
 
 
Jamie Fryatt
Guest
Posts: n/a
 
      02-10-2004
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
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OT: Number Nine, Number Nine, Number Nine FrisbeeŽ MCSE 37 09-26-2005 04:06 PM
The number name 'System.Web.UI.WebControls' contains more than the maximum number of prefixes. The maximum is 3. mayur ASP .Net 2 07-02-2004 10:35 AM
real number to 16 bit signed number hari VHDL 6 05-02-2004 04:10 PM
IE 6.0 sockets number (TCP/IP channels number) for the same Site ??? taras ASP .Net 1 04-17-2004 04:51 AM
Convert decimal number in binary number makok VHDL 1 02-23-2004 06:04 PM



Advertisments