trunc Function [AX 2012]

Updated: December 10, 2009

Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

Truncates a real number by removing any decimal places.


real trunc(real _decimal)

Parameter

Description

_decimal

The number to truncate.

A number that is equivalent to the value of the _decimal parameter with the decimal places removed.

This function always rounds numbers down to a complete integer.

The following example truncates 2.7147 to 2.00.

static void truncExample(Args _arg)
{
    real r;
    ;
    r = trunc(2.7147);
    print strFmt("r = %1",  r);
    pause;
}

Announcements: To see known issues and recent fixes, use Issue search in Microsoft Dynamics Lifecycle Services (LCS).

Community Additions

ADD
Show: