The Number.halfAdjust function () API allows you half adjust or round a number provided to the functionnumeric value to a specific number of decimal positions.
Parameters
- NumberNumeric value
- Number of decimals in result value
Return Value
Rounded value
Examples
Code Block | ||
---|---|---|
| ||
pjs.define("num", { type: 'packed decimal', length: 15, decimals: 5 }); num = 9.876; num = Number.halfAdjust(num, 2); return num; //9.88 |