Scope
Objects: Procedures, Transactions, Web Panels, Work Panels Languages: .NET, Java, Ruby, RPG, Cobol, Visual FoxPro
Purpose
To truncate the value of a given numeric expression.
Syntax
Trunc(numeric-expression, nK)
Type Returned: Numeric
Where: numeric-expression Must be a numeric expression containing constants, attributes, GeneXus functions or variables.
nK Must be a non-negative numeric constant.
Description
Truncates the value of numeric-expression to nK decimals.
ExamplesTrunc(1.5, 0) = 1 Trunc(1.4, 0) = 1 Trunc(1.25, 1) = 1.2 Trunc(1.24, 1) = 1.2 &sum = 146 &count = 10 &avg = Trunc(&sum / &count , 0)
// Result: &avg = 14
See Also
Round Function Truncate Method
|