Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Dave Weitzel
Breaking us phone numbers into parts
September 18, 2013 5:41 AM
Answer

Dave Weitzel

Rank: Regular Member

Posts: 203

Join Date: November 18, 2009

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!
Ahmed Hasan
RE: Breaking us phone numbers into parts
September 18, 2013 7:20 AM
Answer

Ahmed Hasan

Rank: Expert

Posts: 306

Join Date: April 13, 2007

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
Jack Bakker
RE: Breaking us phone numbers into parts
September 18, 2013 8:54 AM
Answer

Jack Bakker

Rank: Liferay Master

Posts: 840

Join Date: January 3, 2010

Recent Posts

you might like this http://code.google.com/p/libphonenumber/