User:anonymousLog inRegister
Recents:
Trunc Function

Scope

Objects: Procedures, Transactions, Web PanelsWork 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.

Examples

Trunc(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

Created: 07/29/08 04:51 PM by dmarquez Last update: 08/03/10 06:21 PM by blima ginzo
 
Page
Categories
Group
 
Powered by GXwiki 3.0 (generated with GeneXus X Evolution 1 U3)