Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way with the ABS() to show % of the differenc
Message
From
03/11/2000 11:15:00
 
 
To
03/11/2000 10:09:05
Mike Mattos
Nationwide Computers
Mississauga, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00437296
Message ID:
00437667
Views:
19
>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 !
------------
Hi Mike and thanks for the function. I can use it....:))
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Previous
Reply
Map
View

Click here to load this message in the networking platform