Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • number - a JavaScript number (or numeric experessionexpression) that is to be formatted
  • editCode - character representing an edit code. The following table describes the possible edit codes:

Edit Code DescriptionNo SignCr Sign-Sign(R)-Sign(L)
Commas and zero balances1AJN
Commas2BKO
Zero Balances3CLP
No commas or zero balances4DMQ
Hexidecimal Hexadecimal F/D SignX   
Date editY   
Suppress leading zeroesZ   

...

Code Block
themeEclipse
languagejavascript
var Xval0 = 1000;
pui.editCode(Xval0, "J"));                               // "1,000  "
pui.editCode(Xval0, "J", "$");                          // "$1,000 "
pui.editCode(Xval0, "J", 9, 2);                         // "    1,000.00 "
pui.editCode(Xval0, "J", 9, 2, "$");                    // "    $1,000.00 "
pui.editCode(Xval0, "J", 9, 2, { decimalEdit: "," });   // "    1.000,00 "

var Yval1 = "-25";
pui.editCode(Yval1, "1", 9, 2);                         // "      25.00"
pui.editCode(Yval1, "A", 9, 2);                         // "      25.00CR"
pui.editCode(Yval1, "J", 9, 2);                         // "      25.00-"
pui.editCode(Yval1, "N", 9, 2);                         // "      -25.00"

var Zval2 = 0.5;
pui.editCode(Zval2, "P");                               // " 0.5"
pui.editCode(Zval2, "P", 9, 2, { decimalEdit: "." });   // "       .50"
pui.editCode(Zval2, "P", 9, 2, { decimalEdit: "," });   // "       ,50"
pui.editCode(Zval2, "P", 9, 2, { decimalEdit: "0." });  // "      0.50"
pui.editCode(Zval2, "P", 9, 2, { decimalEdit: "0," });  // "      0,50"

...