Sunday, 3 September 2017

AX: Convert Amount to Amount In Words

In Dynamics Ax, There are certain condition happens in which we need to convert the amount into Amount in words. Below Job will assists you to achieve this :

static void ConvertAmountInWords(Args _args)
{
    real    _amount;
     int             amount;
    str             amount2Words;
    _amount =4123456;

    amount       = real2int(round(_amount , 1));
    amount2Words = Global::numeralsToTxt(amount);
    amount2Words = subStr(amount2Words,5,strLen(amount2Words)-4);
    amount2Words = subStr(amount2Words,strLen(amount2Words)-10,-strLen(amount2Words));
    amount2Words = strUpr(amount2Words) + ' ONLY';

    info(strFmt("%1", amount2Words));

}

No comments:

Post a Comment