Page 1 of 1

Formatting Zip Codes

Posted: Wed May 18, 2011 11:38 am
by ACordero
Hi Guys,

I'm having a hard time figuring out how to format proper zip codes.

The field in the DataBand looks like this:

Code: Select all

{QueryResults.Customer_Zip}
Which displays results in this format:

Code: Select all

000000000
I need it to format this zip code like this:

Code: Select all

00000-0000

I tried to edit it by clicking Text Format, selecting Custom, and typing #####-#### and it still excludes the hyphen. Do you guys have a quick fix to this?

Thanks!

Formatting Zip Codes

Posted: Thu May 19, 2011 4:54 am
by Ivan
Hello,

First, make sure that your field is of type int.
Also please use the '0' char instead of '#':
"#" Digit placeholder - Replaces the pound sign with the corresponding digit if one is present; otherwise, no digit appears in the result string.
"0" Zero placeholder - Replaces the zero with the corresponding digit if one is present; otherwise, zero appears in the result string.
For example please use the following string as Custom text format:

Code: Select all

00000-0000
Thank you.