« NormalizePhoneNumber (rtl) » : différence entre les versions

De Wiki1000
Aucun résumé des modifications
Aucun résumé des modifications
 
(2 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
{{latest}}
{{Version700}}
<source lang="delphi">Function NormalizePhoneNumber(const iNumber,iCountryCodeISO:string; iHuman:boolean):string;</source>
<source lang="delphi">Function NormalizePhoneNumber(const iNumber,iCountryCodeISO:string; iHuman:boolean):string;</source>


Ligne 47 : Ligne 47 :
[[category:RTL Chaîne]]
[[category:RTL Chaîne]]
[[Category:Mobiles]]
[[Category:Mobiles]]
[[Category:Latest]]
[[Category:Version700]]

Dernière version du 13 janvier 2015 à 09:48

{{#images:version700-32x32.png|stock}} <source lang="delphi">Function NormalizePhoneNumber(const iNumber,iCountryCodeISO:string; iHuman:boolean):string;</source>

Cette fonction normalise un numéro de téléphone suivant le format international.

Result Le numéro de téléphone normalisé
iNumber Le numéro à normaliser
iCountryCodeISO Le code ISO du pays (3 ou 2)
iHuman Formate le numéro pour être affiché.
Tip : Cette fonction utilise une table interne des pays

Exemple

<source lang="delphi">

procedure foo(); begin

 ....
    if Assigned(contact) and (contact.phone<>) then
     begin
       json.result[indx].t := 'phone';
       json.result[indx].v := Format('%s phone :%s',[contact.firstName,NormalizePhoneNumber(contact.phone,inst.countryISO,true)]);
       json.result[indx].l := 'l';
       json.result[indx].h := 'tel:'+NormalizePhoneNumber(contact.phone,inst.countryISO,false);
       indx := indx+1;
     end;
 ...

end; </source>

Voir aussi:

{{#if:Développement DSM|

{{#if:Développement DSM|— Développement DSM |}} — Développement DSM

|

{{#if:|— [[{{{1}}}]] |}} — Développement DSM

}}