CurrencyExchangeHelper::roundWithRule Method [AX 2012]
Rounds the specified amount based on the specified rounding rules.
Syntax
Note
The syntax of this method varies based on the version of Microsoft Dynamics AX that you are using.
Microsoft Dynamics AX 2012 R3
client server public static Amount roundWithRule(
Amount _amount,
RoundOff _roundOffAmount,
RoundOffType _roundOffType)
Microsoft Dynamics AX 2012 R2 (SYS)
client server public static Amount roundWithRule(
Amount _amount,
RoundOff _roundOffAmount,
RoundOffType _roundOffType)
Microsoft Dynamics AX 2012 Feature Pack (SYS)
client server public static Amount roundWithRule(
Amount _amount,
RoundOff roundOffAmount,
RoundOffType roundOffType)
Microsoft Dynamics AX 2012 (FPK)
client server public static Amount roundWithRule(
Amount _amount,
RoundOff roundOffAmount,
RoundOffType roundOffType)
Microsoft Dynamics AX 2012 (SYS)
client server public static Amount roundWithRule(
Amount _amount,
RoundOff roundOffAmount,
RoundOffType roundOffType)
Run On
Called
Parameters
- _amount
Type: Amount Extended Data Type
The amount to round.
- _roundOffAmount
Type: RoundOff Extended Data Type
The round-off amount.
- _roundOffType
Type: RoundOffType Enumeration
The round-off type.
Return Value
Type: Amount Extended Data Type
The rounded amount, based on the rounding rules that are provided.
Remarks
The way in which the amount is rounded is determined by the following information:
When the _amount parameter is set to 0 (zero), this method always returns 0.
When the _roundOffAmount parameter is set to 0, this method rounds to the default round-off amount. If the _roundOffType parameter is set to the RoundOffType::Ordinary enumeration value, the default round-off amount is 0.01; otherwise, the default round-off amount is 1.0.
When the _roundOffType parameter is set to the RoundOffType::Ordinary enumeration value, this method rounds to the nearest round-off amount.
When the _roundOffType parameter is set to the RoundOffType::RoundDown enumeration value, this method rounds toward 0, to the nearest round-off amount.
When the _roundOffType parameter is set to the RoundOffType::RoundUp enumeration value, this method rounds away from 0, to the nearest round-off amount.