Official Content

Rounds the value of a given numeric expression

Syntax

Round( nExp1 , nK)

Where:

nExp1
   Must be a numeric expression.

nK
   Must be a numeric constant o variable.

Type Returned:
Numeric

Scope

Objects: Procedure, Transaction, Web Panel, Panel, Data Provider
Generators: .NET, .NET Framework, Java, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3), Apple, Android, Angular

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.

Samples

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

  




   
Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant