The Number.halfAdjust function allows you half adjust or round a number provided to the function.
Parameters
- NumberDecimals
- Number of decimals in result value
Examples
Code Block | ||
---|---|---|
| ||
pjs.define("result2num", { type: 'packed decimal', length: 15, decimals: 5 }); pjs.define("c15b", { type: 'char', length: 15, initValue: ' + 9 , 8 7 6 ' }); result2num = pjs.dech(c15b, 59.876; num = Number(num, 2); return result2; //9.88 |