473,472 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

number formating!

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
Jul 19 '05 #1
2 1466
<%=right("000" & strnum, 3)%>

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


"Jamie Fryatt" <ja**********@btconnect.com> wrote in message
news:c0**********@sparta.btinternet.com...
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

Jul 19 '05 #2
thanks aaron :-)
"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:#C**************@tk2msftngp13.phx.gbl...
<%=right("000" & strnum, 3)%>

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


"Jamie Fryatt" <ja**********@btconnect.com> wrote in message
news:c0**********@sparta.btinternet.com...
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


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: mr_burns | last post by:
Hi, I am tryin to format a number from, for example, 1 to '01'. How is this done? Cheers Burnsy
2
by: Nadav | last post by:
Hi, How can I use C# to print a number in hexadecimal e.g. printf(" %x "); or print 15 ( decimal ) as 'F' (hexa) Can a number be printed as binary as-well? Thanks in advance, Nadav.
4
by: Eric | last post by:
Hi, In my application I need to round a number to 3 decimal places. I am using the Math.Round method which works fine. The problem I am running into is when the number has no decimals like 5...
0
by: rodrigo guerra | last post by:
where i can change the code formating that visual studio does in the code.... like if i type: if ( ) { .... } visual studio changes to:
0
by: SimonZ | last post by:
Hi, I set the globalization settings to: <globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8" culture="en-GB" uiCulture="en" /> Everything is just fine, only...
3
by: Smiley | last post by:
Hi, I know how to do confitional formating in Excel by clicking the wizard. Is this possible in MS Access ? If so, please directly where to look. I found example but nothing as to how to do it....
12
tolkienarda
by: tolkienarda | last post by:
hi all I am working on a content management service and i need some help keeping formating. what i am doing is recreating my site in an admin side and all of the articles on the site will...
1
by: Shawn Northrop | last post by:
I just read an article on kirupa.com about incorporating mySQL and PHP with flash. I am dynamically loading conent into a flash movie and am not sure how to format. In my php code i have: $y = "";...
0
by: Fonix | last post by:
I'm trying to make table border with pyExcelerator. As i can see there is only cell formating!? If i'm wrong pls tell me what is method to make more then one cell to have same format, other then...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.