DataBasic Reference > Statements and Intrinsic Functions > R > ROUND Function

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

Reality V15.0 ()

ROUND Function (DataBasic) (m618703+round_f.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

ROUND Function

Rounds a numeric value to the specified number of decimal places.

Syntax

ROUND(x, y)

Syntax Elements

x is a numeric variable or string.

y is the number of decimal places that will be retained after the rounding takes place.

Operation

ROUND rounds it's argument up or down to the nearest value with the specified number of decimal places. For positive numbers it rounds 5 up. Negative numbers are rounded as if they were positive, but the sign is retained.

If the number of decimal places exceeds the current precision, ROUND will only affect numbers which have not already been shortened by operations determined by the PRECISION statement. See also the TRUNC function.

Examples

A = 125.3456
B = ROUND(A,2)
PRINT B

prints 125.35.

X = 3.50
Y = ROUND(X,0)
PRINT Y

prints 4.

RealityV15.0Comment on this topic