E r g e b n i s / R e s u l t
Findet den Prozentsatz einer Zahl zu einer Anderen.
Find the percentage of one number by another
B e s c h r e i b u n g / D e s c r i p t i o n
This function performs a simple percentage operation on two numbers.
However, it also prevents a zero divide occurring.
This may be useful to users of Screen Forms or Programmer who otherwise
suffer rude messages from Open Access.
S y n t a x
Code:
result = call ('PERCENT' , value1 , value2) P a r a m e t e r
value1 - an integer or decimal.
value2 - an integer or decimal.
result - a decimal value. If the divisor is zero then the result
is set to 0.0. Otherwise the following calculation is
performed value1 / value2 * 100.
R e t u r n s
A decimal value
B e i s p i e l / E x a m p l e
Code:
attach 'TOOLS'
put call ('PERCENT' , 4 , 8 ) ! prints 50.00000
a = 10.0
b = 0
put call ('PERCENT' , a , b) ! prints 0.00000 without a warning
! message appearing
detach 'TOOLS' Q u e r v e r w e i s / C r o s s R e f e r e n c e
DIVIDE