473,394 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

remove preceding zeroes in ASP

JT
how would i transform this number: 00000102 into 102

basically, i just want to remove all preceding zeroes, but not replace all
zeroes
Jul 19 '05 #1
6 1683
The easiest way in this case would be to CInt your number.

s = "00000102"
snew = CInt(s)
response.write snew

Ray at work

"JT" <je******@sppinc.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
how would i transform this number: 00000102 into 102

basically, i just want to remove all preceding zeroes, but not replace all
zeroes

Jul 19 '05 #2
Ray at <%=sLocation%> wrote on 15 jan 2004 in
microsoft.public.inetserver.asp.general:
The easiest way in this case would be to CInt your number.

s = "00000102"
snew = CInt(s)
response.write snew


or:

s = "00000102"
response.write +s

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3
"JT" <je******@sppinc.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
how would i transform this number: 00000102 into 102

basically, i just want to remove all preceding zeroes, but not replace all
zeroes


<%
var = CInt("00000102")
%>

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Jul 19 '05 #4
you might want to use CLng rather than CInt unless you know that the number
will never be greater than 32k.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:eo**************@tk2msftngp13.phx.gbl...
The easiest way in this case would be to CInt your number.

s = "00000102"
snew = CInt(s)
response.write snew

Ray at work

"JT" <je******@sppinc.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
how would i transform this number: 00000102 into 102

basically, i just want to remove all preceding zeroes, but not replace all zeroes


Jul 19 '05 #5
Depending on the exact kind of data he anticipates, a totally different
approach may be needed, like of the data will wind up being "0000102A"
"00000102B" and things like that. But I guess we'll see.

Ray at home

"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:uT*************@TK2MSFTNGP12.phx.gbl...
you might want to use CLng rather than CInt unless you know that the number will never be greater than 32k.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:eo**************@tk2msftngp13.phx.gbl...
The easiest way in this case would be to CInt your number.

s = "00000102"
snew = CInt(s)
response.write snew

Ray at work

"JT" <je******@sppinc.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
how would i transform this number: 00000102 into 102

basically, i just want to remove all preceding zeroes, but not replace all zeroes



Jul 19 '05 #6
well... he did say "number" in his post. whether he meant it or not is
another story.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Ray at <%=sLocation%>" <myFirstNameATlane34dotKOMM> wrote in message
news:O$**************@TK2MSFTNGP12.phx.gbl...
Depending on the exact kind of data he anticipates, a totally different
approach may be needed, like of the data will wind up being "0000102A"
"00000102B" and things like that. But I guess we'll see.

Ray at home

"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:uT*************@TK2MSFTNGP12.phx.gbl...
you might want to use CLng rather than CInt unless you know that the

number
will never be greater than 32k.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:eo**************@tk2msftngp13.phx.gbl...
The easiest way in this case would be to CInt your number.

s = "00000102"
snew = CInt(s)
response.write snew

Ray at work

"JT" <je******@sppinc.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
> how would i transform this number: 00000102 into 102
>
> basically, i just want to remove all preceding zeroes, but not
replace all
> zeroes
>
>



Jul 19 '05 #7

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

Similar topics

2
by: Sven | last post by:
Hi I have the following XML & XSLT: XML: <?xml version="1.0" encoding="utf-8"?> <Source Source="IBM"> <Detail> <UserID></UserID>
2
by: KJ | last post by:
Hello All, I'd like to know what the difference is between these 2 expressions: parent::*/preceding-sib­ling::tagname VS parent::preceding-sib­ling::tagname
0
by: DG | last post by:
I have added calculated column to datatable and expression looks like this: "somecolumn + datetimecolumn1" now, i do not want zeroes from datetime, just date. How to do it? Thanx. my...
3
by: patrizio.trinchini | last post by:
Hi, how can remove sibling elements based on the value of an attribute ? For instance, gven the XML document: <root> <parentElment> <testElement name="A"> <removableElement/>
74
by: Zytan | last post by:
I have a struct constructor to initialize all of my private (or public readonly) fields. There still exists the default constructor that sets them all to zero. Is there a way to remove the...
2
by: tomlebold | last post by:
How do you remove leading zeroes in a column? Update 0000123456 to 123456
8
by: stainless | last post by:
Is it possible, using the ToString function, to take an integer and conver to a string of fiexd width with the leading spaces padded with zeroes. e.g. integer 123 converted to a string of length...
2
by: saengpole | last post by:
Hi all, I'm a newbie in VB2005. I have a trouble getting text from textbox and combobox.SelectedValue. The values reside on two controls are text. But they are in numeric text eg. product code...
1
by: rnakawat | last post by:
I seem to have a problem using the preceding:: on substrings of the value. I'll try to explain with an example: Let's say I had a XML that look like: <Root> <Row> <Cell Name="Street"...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.