473,326 Members | 2,655 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,326 software developers and data experts.

How To Append Trailing Zero

for example:
A1 = 123
A1=123000 <- final result

A1 =1234
A1=123400<- final result

A1=1
A1=100000<-final result

How do i append trailing zero? is there a function that i
can use for this?
i cannot use format(A1,"000000") because it append zero in
front.
Nov 20 '05 #1
3 7913
Keali,
Is A1 a String or a Integer?

Have you tried the String.PadRight function?

Dim A1 As String = "123"
A1 = A1.PadRight(6, "0"c)

If A1 is an Integer, I'm not sure of a "better" (another) method then
converting to a string, using PadRight, and converting back.

Hope this helps
Jay

"keali" <ke*******@fastmail.fm> wrote in message
news:d3****************************@phx.gbl...
for example:
A1 = 123
A1=123000 <- final result

A1 =1234
A1=123400<- final result

A1=1
A1=100000<-final result

How do i append trailing zero? is there a function that i
can use for this?
i cannot use format(A1,"000000") because it append zero in
front.

Nov 20 '05 #2
You could do

A1 = CStr(123).PadRight(5,"0")
This will pad your var to a _total width_ of 5, .... not "with 5 zeroes".

Or if you know you need it padded with 5 zeroes always, you could do
A1 = 123 * (10^5)

"keali" <ke*******@fastmail.fm> wrote in message
news:d3****************************@phx.gbl...
for example:
A1 = 123
A1=123000 <- final result

A1 =1234
A1=123400<- final result

A1=1
A1=100000<-final result

How do i append trailing zero? is there a function that i
can use for this?
i cannot use format(A1,"000000") because it append zero in
front.

Nov 20 '05 #3
Hi Jay B. Harlow [MVP - Outlook], Eidolon

thank for the reply, it's really help me a lot
thank a zillions :)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #4

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

Similar topics

2
by: Keali | last post by:
for example: A1 = 123 A1=123000 <- final result A1 =1234 A1=123400<- final result A1=1 A1=100000<-final result
4
by: yaffa | last post by:
dear folks, i have the following lines of python code: couch = incident.findNextSibling('td') price = couch.findNextSibling('td') sdate = price.findNextSibling('td') city =...
2
by: John Baker | last post by:
Hi: I have a situation where I am appending records to a table, and some of the records do NOT have all the fields in them that the table has. In those cases, the field is filled with a null but...
3
by: Andy B | last post by:
I've tried using Trim or RTrim to strip trailing space characters from my data. When I check on the transformed data space characters are still there. We have an address table containing two...
3
by: V. Jenks | last post by:
I need to store money values in C# and I noticed when using a float, the trailing zero was trimmed off automatically. I don't want this, is there a native type that will *not* do this so I can...
1
by: KevinGPO | last post by:
I am wondering about what's the best and easiest way to strip trailing whitespace from every single file in a folder, recursively. I want to write a program/script so that you pass in a folder...
1
by: ChrisMoss | last post by:
I have written a macro that I want to repeat until there are no more records to append (i.e., append zero rows). Is there a way for a condition to be applied to the macro that can detect if no...
9
by: Chester | last post by:
I'm working on an app that records data collected by service technicians (VB.Net front-end, SQL Server 2000 back end). The technicians need to record numbers with varying scale and precision. For...
7
by: toofunny24 | last post by:
The query function is: SCHEDULE BBLS: IIf(=11.2,Format(/14.77,"###00.00",0)) The schedule cases amt in this case is 13600. The above formula produces 920.79000. How do I get rid of the trailing...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.