TEXT AND NUMBERS FORMAT

72 views
Skip to first unread message

eliel.cwb

unread,
Nov 25, 2009, 10:34:33 AM11/25/09
to XMPie Interest Group
Hi everybody, I'm having problems with the formatting of phone numbers
and zip codes in a business card.
For example: the content of the BD for the phone field is 1121213000.
I would like to format it automatically when it is placed into a
desing already with the format (11) 2121 3000 (including blank spaces)

I created a new field "Cel2" and I inserted on it the following code:

if(|->[CEL] <> "")
{
"- " + FormatNumber(AsNumber(|->[CEL]), "(##) #### ####")
}
else
{
""
}

The formatting is going nice, but when the field is empty it get
filled with zeroes.

I need some help guys.

JasonSpr

unread,
Nov 25, 2009, 11:30:52 AM11/25/09
to XMPie Interest Group
Not sure why you're getting 0 instead of "", but if that is the case,
maybe adding another line somewhere that does if cel = 0 then return
"" might get rid of it.

Bill

unread,
Nov 25, 2009, 11:55:16 AM11/25/09
to XMPie Interest Group
Can you try

if(Length(Trim(|->[CEL])) > 0)

instead of

if(|->[CEL] <> "")
Reply all
Reply to author
Forward
0 new messages