Skip to main content
Known Participant
June 28, 2023
Question

Round up

  • June 28, 2023
  • 1 reply
  • 256 views

Currently I am using the simplified field notation to get my calculation. It is currently FieldA / FieldB. The number that is displayed is always a whole number since I have it formatted for 0 decimals. I want it to always visually show a whole number, but I want it to round up. If the number is 24.01 I want it to display 25. Currently it will display 24, and when I select the field I would see the 24.01. I want to see 25, and when I select the field see 24.01. Is this possible?

This topic has been closed for replies.

1 reply

Karl Heinz  Kremer
Community Expert
Community Expert
June 29, 2023

This is possible, but not with the simplified field notation. You would have to use a custom calculation script for this to work. 

 

event.value = Math.ceil(this.getField("FieldA").value / this.getField("FieldB").value);

This does not contain any error checking (e.g. FieldB could be zero, or eiher field could be a non-numeric value), but as long as you have "good" values, it will produce the correct results.