web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Amount Conversion with currency

(0) ShareShare
ReportReport
Posted on by 534

Hi Guys,

How to convert the amount with currencies into the word.

Example - $400.52 = Four Hundred Dollars and Fifty Two Cents 

I have the same question (0)
  • Suggested answer
    Adria Ariste Profile Picture
    User Group Leader on at
    RE: Amount Conversion with currency

    Hi,

    There's a method in the Global class called numeralsToTxt (with other methods for different countries). This won't display the dollars or cents but you can create a method based on this one that does (check the numeralsToTxt_ES method which is displaying currency info as an example).

    Regards,

    Adrià Ariste - Senior technical consultant @ Axazure - Read my blog!

  • MATTGUO Profile Picture
    22,344 Moderator on at
    RE: Amount Conversion with currency

    Hi Jenifer,

    You can convert the number into text by the method :  Global::numeralsToTxt.

    Please read the following article:

    www.axpulse.com/.../.

    The code is very detailed and available in D365.

  • Adam123 Profile Picture
    534 on at
    RE: Amount Conversion with currency

    I have used the global class , but I can't able to remove this 00/100 ,how to remove this

    I am trying to modify in this code by taking the duplicate of this class.

    if (numOfPennies)
    {
    returntxt = returntxt + ' ' + #text_and + ' ' + num2Text(numOfPennies) + 'cents';
    }
    else
    {
    returntxt = returntxt + ' ' + #text_and + ' ';
    }

    1256.Captures.PNG

  • Verified answer
    MATTGUO Profile Picture
    22,344 Moderator on at
    RE: Amount Conversion with currency

    Hi Jenifer,

    You can use X++ String runtime function to avoid it.

    docs.microsoft.com/.../xpp-string-run-time-functions

    if (decimals == 0.00)

           {

               word = strdel(strpoke(word, strfmt(' %1 and No %2', _currency1, _currency2), repPos), 1, 4);

           }

           else

           {

               decWord = substr(num2str(decimals, 0, 2, 1, 1), 3, 2);

               decWord = Global::numeralsToTxt_EN(str2num(decWord));

               repPos1 = strscan(decWord, ' and', 1, strlen(decWord));

               decWord = strpoke(decWord, strfmt(' %1', _currency2), repPos1);

               decWord = strdel(decWord, 1, 4);

               word = strdel(strpoke(word, strFmt(' %1 and %2', _currency1, decWord), repPos), 1, 4);

               word = strdel(word, strscan(word, '/100', 1, strlen(word)), 4);

           }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,167

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 867 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 617 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans