RE: Breaking us phone numbers into parts

thumbnail
Dave Weitzel, modified 12 Years ago. Regular Member Posts: 208 Join Date: 11/18/09 Recent Posts
Is there any easy way of retrieving the three parts of a 10 digit US phone number?
Paypal requires the phone number t be sent as three separate parts when a USA number but I cannot work out how to do this from the lIferay API and use of phoneNumberFormats. For instance will liferay always store as (123)-456-7890 if 10 digits provided or 456-7890 if only 7?
If so I can easily process those strings!
thumbnail
Ahmed Hasan, modified 12 Years ago. Expert Posts: 306 Join Date: 4/13/07 Recent Posts
Hi Dave,

I feel this is nothing to do with Liferay. You can split the string that is stored in the database as 10 digits and show them on the front-end the way you want using NumberFormat utility.

Yours truly,
Ahamed Hasan
Author, Liferay Portlet Cookbook
thumbnail
Jack Bakker, modified 12 Years ago. Liferay Master Posts: 978 Join Date: 1/3/10 Recent Posts
you might like this http://code.google.com/p/libphonenumber/