Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a way with the ABS() to show % of the differenc
Message
De
03/11/2000 10:09:05
Mike Mattos
Nationwide Computers
Mississauga, Ontario, Canada
 
 
À
02/11/2000 17:37:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00437296
Message ID:
00437611
Vues:
22
If I understand correctly you need something like

deltapercent= mypercentfunction(0ldvalue,newvalue, abval )

you also need business rules, is an increase in a debt to be reported as an increase, or a decrease? so a third parameter, abval can be passed


FUNCTION mypercentfunction
lparameter Oldvalue, newvalue, abval

IF oldvalue = newvalue
return 0
endif

IF oldval=0 .and. abval
return 100
endif
IF oldval = 0 .and abval < 0
return -100
endif
IF abval
delta=(abs(oldval)*100 - abs(newval))*100 )/abs(oldval
* multiply by 100 first to increase accuracy of rounding !
return delta
endif



you probably need to add soem more conditions , too !

not an easy task, given how math challenged most clients are !
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform