userEditCodes
The values for each code should match exactly what is configured on your IBM i system via WRKEDTD.
Description
Set this option to an object containing definitions for IBM i user-defined edit codes ("5" through "9"), as configured with the WRKEDTD command on your IBM i system.
These definitions are used both at conversion time (DDS to PUI JSON) and at run time, when RPG programs call %EDITC() with a user-defined code.
Properties
Each key is a single digit ("5" through "9"). The value is an object with the following properties:
Property | Description |
|---|---|
| Integer portion mask string (commas indicate thousands separators). |
| Decimal point character ( |
| Fractional digits mask string. |
| Fill/pad character (for example |
| Currency symbol string (for example |
| Boolean. Whether to display zero values. |
| Sign indicator for negative values ( |
| Suffix appended to positive values (for example |
| Constant string prepended to the formatted value. |
| Constant string appended to the formatted value. |
Example
Two user-defined edit codes matching a WRKEDTD configuration:
userEditCodes: {
// Edit code 8: currency, always show zeros, minus sign for negatives.
"8": {
integerMask: " , , , , 0 ",
decimalPoint: ".",
fractionMask: " ",
fillCharacter: "",
currencySymbol: "$",
editZeroValues: true,
negativeStatus: "-",
positiveStatus: " ",
leftConstant: "",
rightConstant: ""
},
// Edit code 5: suppress zeros, CR/DR suffixes instead of a sign.
"5": {
integerMask: " , , , , 0",
decimalPoint: ".",
fractionMask: " ",
fillCharacter: "",
currencySymbol: "",
editZeroValues: false,
negativeStatus: "CR",
positiveStatus: "DR",
leftConstant: "",
rightConstant: ""
}
}For information on how to modify this setting, see Configuration File.