Convert to decimal and half adjust.
Parameters
- Value / field
- Total length (optional)
- Decimal places - does not add to the total length (optional)
Example
Example 1: char -> packed decimal
Code Block | ||
---|---|---|
| ||
pjs.define("p1", { type: 'packed decimal', length: 15, decimals: 5 }); pjs.define("c15b", { type: 'char', length: 15, initValue: ' + 9 , 8 7 6 ' }); p1 = pjs.dech(c15b, 5, 2); return p1; //9.88000 |
RPG Equivalent
%DECH()