m-Power and Edit Codes
Are you new to the IBM and not very familiar with Edit Codes? Or have you not dealt with Edit Codes in some time? Not sure the difference between "J", "X", and "A"? Not to worry — not all of our customers are proficient with edit codes and now with m-Power applications, you don't need to be! The new flexibility of m-Power applications will allow you to add edit codes directly to the source of your application.
Note: Of course, the standard edit codes that many of you are comfortable and familiar with will still work in the same fashion. However, this new method of adding edit codes allows for much more flexibility within your applications.
In addition, Edit Codes are primarily known for Numeric Fields. The following manipulations modify your numeric fields into strings for additional manipulation capabilities.
Numeric Manipulation Examples
Pre-Defined Currency Formatting Mask
Be sure to compile your application. After the program is compiled, enter m-Painter.
Right click on the field you wish to add formatting on (In our case it is the field named "Currency") and select "Cell" then "Edit Cell HTML".
Within this text area, append the text _o?string.currency
directly after the field name. This _o?string.currency
tells your field that you wish to utilize a currency mask on the field.
Note: The entire field now reads ${row.CURRENCY_o?string.currency}
The output is as follows (notice the "$" and the "." Denoting cents):
Pre-Defined Percent Formatting Mask
Similarly, we can follow the same steps as above, this time adding _o?string.percent
directly after the name of the field.
The resulting output is:
Modifying the Code for European Currency
In some European countries, $1,120.50 would be listed as 1 120 ,50. To do this in m-Power, open m-Painter. Right-click on the main data table and select "Table" then "Edit Table HTML".
Look for your currency field within this text area.
Directly above the table rows, add: <#setting locale="hu">
and to your field add FIELD_o?string.currency
. See below:
Your output will look like this: