Khelvaster
Khelvaster

Reputation: 872

What is the _isMexican boolean for in the Global::Checkpower method?

Quite simply, what is this method for, and what is _isMexican? My online searching has proven futile.

http://msdn.microsoft.com/en-us/library/global.checkpower.aspx

Upvotes: 1

Views: 246

Answers (1)

Nicholas Peterson
Nicholas Peterson

Reputation: 335

This has to do with how Dynamics AX translates numeric currency values into text.

Try creating a new job in the AOT with the following contents:

static void Job1(Args _args)
{
    info(Global::numeralsToTxt_ES(120000.45,GenderMaleFemale::Female,0,"MXN",1,0));
}

The parameters are as follows:

  1. Currency Amount
  2. Gender
  3. Enclose (not certain)
  4. ISO Currency Code
  5. isMexican Boolean
  6. isCheck Boolean

With isMexican = 1, it outputs this result: Ciento veinte mil 45/100

With isMexican = 0, it outputs this result: CIENTO VEINTE MIL con CUARENTA Y CINCO centimos

So basically, this is a text formatter for translation of currency amounts into a given language. Some languages or Countries have specific ways they want the written form to appear, that boolean influences it.

The CheckPower method is part of this logic, and it recursively calls itself to iterate over all the powers of a given currency (Billions, Millions, etc), each time adding the proper word to the currency string.

Upvotes: 3

Related Questions