Link to home
Create AccountLog in
Avatar of baralp
baralp

asked on

Change the Number field format to Phone number format

i am using crystal report XI, I have a  Number field thats stores phone number. I used the following code to change it to phone number format but its still giving me in decimals.

/whileprintingrecords;
numbervar y;
y:=round({T_CONTACT.PHONE_NUMBER});
totext(y,"0");
picture(y,"(xxx) xxx-xxxx" );
ASKER CERTIFIED SOLUTION
Avatar of ast2550
ast2550

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of daviper
daviper

I am new to crystal.. Where does this code go, I am trying to do the exact same thing
to daviper.
You can just create a formula and then put it in the report.  So if the field name was PHONENUMBER
go to formulas and create a new one and then enter PICTURE(PHONENUMBER,"(xx) xxxx-xxxx")
save the formula and then drag it onto your report.