AsDisplayString (base type)
De Wiki1000
(Différences entre les versions)
Ligne 5 : | Ligne 5 : | ||
Retourne une chaîne formaté pour l'affichage. | Retourne une chaîne formaté pour l'affichage. | ||
− | {{tip|Le formattage | + | {{tip|Le formattage dépend de la langue de l'utilisateur}} |
Exemple | Exemple | ||
<source lang='delphi'> | <source lang='delphi'> | ||
+ | function foo():string; | ||
begin | begin | ||
+ | montant.Devise := TdbfCurrency.Find('CodeISO=%1','',True,['USD']); | ||
+ | montant.Value := 12345.56; | ||
+ | Result := montant.AsDisplayString; | ||
+ | |||
+ | // if locales are FR : | ||
+ | // Result := 12 345,56 (USD) | ||
+ | // | ||
+ | // if locales are US : | ||
+ | // Result := 12,345.56 (USD) | ||
end; | end; | ||
</source> | </source> |
Version actuelle en date du 2 septembre 2016 à 10:45
property AsDisplayString:String;
Lecture
Retourne une chaîne formaté pour l'affichage.
Exemple
function foo():string; begin montant.Devise := TdbfCurrency.Find('CodeISO=%1','',True,['USD']); montant.Value := 12345.56; Result := montant.AsDisplayString; // if locales are FR : // Result := 12 345,56 (USD) // // if locales are US : // Result := 12,345.56 (USD) end;
Voir aussi
Whos here now: Members 0 Guests 0 Bots & Crawlers 1 |