Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

suppress leading zero

Status
Not open for further replies.

GDI

MIS
May 17, 2002
29
US
How can I suppress leading zeros from a number? Is there an easy function that I can use?
Thanks,
David
 
try this out
dim var111
var111 = "000000321"
KillZeros = CStr(CInt(var111))
alert KillZeros You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
This is the error im getting...
Type mismatch: 'CInt'

this is my statement I'm using...
CStr(CInt(Myretail))

I can make the Data Type of the field and still get the error ...
Character
Integer
Float

Still lost,
David
 
To find out what data type it is use the TypeName function.
msgbox("var111 is a " & TypeName(var111) & " data type")


 
Are any of the leading zeroes actual the letter "O"?
 
The leading zeros are 0(zero) and not o(letter)
 
It was worth a shot. About the only thing I can think of is to try it using a larger numeric data type. Hopeful one of these will work.

KillZeros = CStr(CLng(var111))
KillZeros = CStr(CSng(var111))
KillZeros = CStr(CDbl(var111))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top