pjs.decimalPositions()
Returns the number of decimals within a declared field or constant.
Parameters:
Declared field or constant
Example:
pjs.define("testnum", { type: 'packed decimal', length: 7, decimals: 3 });
pjs.define("result", { type: 'integer', length: 5, decimals: 0 });
testnum = 236.56;
result = pjs.decimalPositions(testnum); // result is 3; testnum is strongly typed with 3 decimal positions
result = pjs.decimalPositions(236.53); // result is 2
var x = 236.56;
result = pjs.decimalPositions(x); // result is 2; x is loosely typed
RPG Equivalent
%DECPOS()
Some documentation pages have recently moved to a new section: Profound AppDev. If you are having trouble finding specific pages, try the documentation search capability or reach out to our Support team!