Skip to content

Commit

Permalink
[ss-2252] Set areacode to 3 digits
Browse files Browse the repository at this point in the history
  • Loading branch information
smanga-11 committed Jun 19, 2024
1 parent 92ce65a commit 2533ddd
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ TelephoneNumber buildTelephoneNumber(String telephoneNumber) {
String significantNumber = phoneNumberUtil.getNationalSignificantNumber(phoneNumber);
int areaCodeLength = phoneNumberUtil.getLengthOfGeographicalAreaCode(phoneNumber);
if (areaCodeLength > 0) {
builder.areaCode(AREA_CODE + significantNumber.substring(0, areaCodeLength));
String substring = significantNumber.substring(0, areaCodeLength);
builder.areaCode(areaCodeLength > 3 ? substring : AREA_CODE + substring);
builder.number(significantNumber.substring(areaCodeLength));
} else {
builder.areaCode(AREA_CODE);
Expand Down

0 comments on commit 2533ddd

Please sign in to comment.