Formatting Zip Codes

Stimulsoft Reports.NET discussion
Post Reply
ACordero
Posts: 25
Joined: Mon Sep 20, 2010 1:03 pm
Location: Valencia, CA

Formatting Zip Codes

Post 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!
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Formatting Zip Codes

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