« Float (rtl) » : différence entre les versions
Aucun résumé des modifications |
m (Remplacement du texte — « Category:Latest » par « Category:Version700 ») |
||
| Ligne 57 : | Ligne 57 : | ||
{{Footer|Développement DSM}} | {{Footer|Développement DSM}} | ||
[[category:RTL Variant]] | [[category:RTL Variant]] | ||
[[Category: | [[Category:Version700]] | ||
Version du 13 janvier 2015 à 08:49
Function Float(const V:Variant):Variant;
Cette fonction convertit un variant en variant de type Float.
| Result | Le variant converti en Float |
| V | Le variant à convertir |
Exemple :
//Procedure Ventiler;
var vCessionBienDetail : TCessionBienDetail;
vTotal : float;
vValeur : float;
vMontant: float;
begin
if cleRepartition.value = repartitionSortie_MontantAcquisition then
vTotal := GetTotalMtAcquisition
else if clerepartition.value = repartitionSortie_valeurnette then
vTotal := GetTotalValeurNette
else
vTotal := GetTotalValeurBrute;
// vTotal,vMontant,vValeur may be very large amount
// convert to float to compute the a/b*c
vTotal := Float(vTotal);
vMontant := Float(montant.value);
forEach vCessionBienDetail in cessionBienDetailList do
begin
if cleRepartition.value = repartitionSortie_MontantAcquisition then
vValeur := vCessionBienDetail.BienComptable.montantAcquisition.value
else if clerepartition.value = repartitionSortie_valeurnette then
vValeur := vCessionBienDetail.GetValeurNetteSortie
else
vValeur := vCessionBienDetail.GetValeurBrute;
if vTotal <> 0 then
vCessionBienDetail.prixCession.value := (vMontant / vTotal) * vValeur;
vCessionBienDetail.Calculer;
end;
end;
Voir aussi: