Einzelnen Beitrag anzeigen
Alt 16.06.2007, 17:30   #38
RKabis
Registrierter Benutzer
Beschreibung vorhanden OSA ROUND

E r g e b n i s / R e s u l t

Rundet den Wert zu einer spezifischen Präzision.
Round a value to a specified precision

B e s c h r e i b u n g / D e s c r i p t i o n
The ROUND function will 'round' a decimal number to a given number of
decimal places. This is different to the Open Access Programmer Round
statement that always rounds numbers to integers.
This flexibility is useful for rounding currency amounts.

S y n t a x
Code:
newvalue = call('ROUND' , value , precision)
P a r a m e t e r
value - is a decimal value
precision - is the number of decimal places the value is to be rounded to.

R e t u r n s
A decimal value, rounded to the correct precision.

B e i s p i e l / E x a m p l e
Code:
attach 'TOOLS'
put call('ROUND' , 3.141592654 , 3) ! prints 3.142
a = 50.38 * 0.10
b = call ('ROUND' , a , 2) ! b contains 5.04
detach 'TOOLS'
Angehängte Dateien
Dateityp: oac TOOLS.OAC‎ (18.5 KB, 3x aufgerufen)
RKabis ist offline   Mit Zitat antworten