Round Function

Official Content
This documentation is valid for:

Scope

Objects: Procedures, Transactions, Web Panels
Languages: .NET, Java, Ruby, Visual FoxPro

Purpose

To round the value of a given numeric expression.

Syntax

Round( nExp1 , nK)

Type Returned
Numeric

Where:
nExp1
   Must be a numeric expression.

nK
   Must be a numeric constant o variable.

Description

This function rounds the value of nExp1 to nK decimals. The rounding threshold is 5. That is, values below 5 are rounded downwards, otherwise the value is rounded upwards.

nK must be a numeric constant or variable. If nK is a negative number, the Round function applies to the integer part of the number.

Examples

Round(1.5, 0) = 2 
Round(1.4, 0) = 1 
Round(1.25, 1) = 1.3

&value = 1
Round(1.24, &value) = 1.2 
Round(125.11, -1) = 130 

&sum = 146 
&count = 10 
&avg = Round(&sum / &count, 0) // Result &avg: 15 

See Also

Round Method
Trunc Function
Truncate Method





Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.