Add this code as the field's custom calculation script:
if (event.value) event.value = Math.ceil(event.value);
no I have the result on a field
and I want to round it up on another field
If the value were 5.4 would you want that value rounded up to the next integer?
Setting the field's format "Number" and setting the desired number of decimal places will cause the displayed result to be rounded up but will not change the value of the field.
One can use the util.printf() method to round a calculation to a desired number of decimal places.
// round the focused field to no decimal places;
var nDec = 0; // variable to use for the number of decimal places to round to. in this case none or zero;
event.value = Number(util.printf("%,101." + nDec + "f", event.value);
D.P. Story has a much more robust function that can round to whole numbers or decimals with rounding.
I found the solution
event.value = Math.ceil(this.getField("Field1").value);