« NormalizePhoneNumber (rtl) » : différence entre les versions
(Page créée avec « <source lang="delphi">Function NormalizePhoneNumber(const iNumber,iCountryCodeISO:string; iHuman:boolean):string;</source> Cette fonction normalise un numéro de téléph... ») |
Aucun résumé des modifications |
||
| (3 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
{{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 46 : | Ligne 47 : | ||
[[category:RTL Chaîne]] | [[category:RTL Chaîne]] | ||
[[Category:Mobiles]] | [[Category:Mobiles]] | ||
[[Category:Version700]] | |||
Dernière version du 13 janvier 2015 à 09:48
Function NormalizePhoneNumber(const iNumber,iCountryCodeISO:string; iHuman:boolean):string;
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é. |
Exemple
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;
Voir aussi: