PC Review


Reply
Thread Tools Rate Thread

How To Append Trailing Zeros

 
 
Keali
Guest
Posts: n/a
 
      14th May 2004
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.
 
Reply With Quote
 
 
 
 
Tom Porterfield
Guest
Posts: n/a
 
      14th May 2004
Keali wrote:

> 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.


What is A1? If it is a string, look at PadRight(int, char).

--
Tom Porterfield
MS-MVP MCE
http://support.telop.org

Please post all follow-ups to the newsgroup only.
 
Reply With Quote
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      14th May 2004
Keali <(E-Mail Removed)> wrote:
> 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.


Use a1 = a1.PadRight(6, '0');

--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Trailing zeros Gatz Microsoft Excel Worksheet Functions 5 30th Apr 2009 08:34 PM
Trailing zeros mccallen60 Microsoft Access Queries 2 18th Sep 2008 05:07 PM
I want to KEEP trailing zeros Chester Microsoft VB .NET 9 18th Dec 2006 10:56 PM
leading zeros & trailing zeros =?Utf-8?B?Q01jR3Jhbm4=?= Microsoft Access External Data 2 5th May 2006 02:47 PM
Add trailing zeros =?Utf-8?B?Sk9N?= Microsoft Access 5 3rd Jan 2006 08:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:58 PM.