Harold Fuchs wrote:
----- Original Message ----- From: "CarlP" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, August 21, 2006 5:55 PM
Subject: [users] Concatenate a string in Calc



Trying to add a leading zero on eastern US zip codes using the Concatenate function as follows:

=CONCATENATE(0;G3)
and
=CONCATENATE("0";G3)

where G3 is the column with zip codes. (The data was brought into a numeric field, hence the leading zero fell off.) But this only shows this formula in the cell, not the result. Note View Formulas is not checked in the Calc Options.


<snip>
1. Works for me on WinXP Pro/SP2 with OOo 2.0.3; which OS and OOo versions are 
you using?

2. Are the codes all to display to the same number of digits? If so, you could 
change the number format to include leading zeros by fixing the length of the 
displayed data: select the column/row and then Format/Format Cells/Leading 
Zeros. This is a bit misleading (IMHO). The number you enter determines the 
width of the actual entry, *not* the number of leading zeros. So if you say 6, 
then the value 1 will show as 000001 and the value 1234 will show as 001234.

Harold Fuchs
London, England

Hmmm. I see what you mean. It's fine in my case, as all zip codes are 5 digits. But I can see some instances where one might always want 2 leading zeros, no matter how many digits or "spaces" the number takes up. Is there any option forthis other than hand-entering the leading zeros in a field formatted as text?

Carl

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to