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
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00437296
Message ID:
00437322
Views:
15
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Percent of what? If you mean, percent of the bigger number, then:

?abs(m1-m2)/max(m1,m2)*100
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Only two quick things I would add to that -- Robert might want to ABS() the whole expression, otherwise, you could get a negative % if the two numbers were both negative; and, watch out if the max of m1 and m2 is zero.... So maybe something kinda ugly like this instead:

? iif(max(m1,m2) = 0, .null., abs((m1-m2)/max(m1,m2)*100))

Yuuck. Anyway, all of this will depend on the practical/business needs.....
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Previous
Reply
Map
View

Click here to load this message in the networking platform