cpp/src/phonenumbers/phonenumberutil.cc
// Appends the formatted extension of a phone number, if the phone number had an
// extension specified.
Appends the formatted extension of a phone number, if the phone number had an
extension specified.
Appends the formatted extension of a phone number if the phone number had an extension specified .
void PhoneNumberUtil::MaybeAppendFormattedExtension(
    const PhoneNumber& number,
    const PhoneMetadata& metadata,
    PhoneNumberFormat number_format,
    string* formatted_number) const {
  DCHECK(formatted_number);
  if (number.has_extension() && number.extension().length() > 0) {
    if (number_format == RFC3966) {
      StrAppend(formatted_number, kRfc3966ExtnPrefix, number.extension());
    } else {
      if (metadata.has_preferred_extn_prefix()) {
        StrAppend(formatted_number, metadata.preferred_extn_prefix(),
                  number.extension());
      } else {
        StrAppend(formatted_number, kDefaultExtnPrefix, number.extension());
      }
    }
  }
}
void PhoneNumberUtil :: MaybeAppendFormattedExtension ( const PhoneNumber & number , const PhoneMetadata & metadata , PhoneNumberFormat number_format , string * formatted_number ) const { DCHECK ( formatted_number ) ; if ( number . has_extension ( ) && number . extension ( ) . length ( ) > 0 ) { if ( number_format == RFC3966 ) { StrAppend ( formatted_number , kRfc3966ExtnPrefix , number . extension ( ) ) ; } else { if ( metadata . has_preferred_extn_prefix ( ) ) { StrAppend ( formatted_number , metadata . preferred_extn_prefix ( ) , number . extension ( ) ) ; } else { StrAppend ( formatted_number , kDefaultExtnPrefix , number . extension ( ) ) ; } } } }
Appends the formatted extension of a phone number, if the phone number had an
extension specified.
Appends the formatted extension of a phone number if the phone number had an extension specified .