Skip to main content


 

Symptoms


Day Difference inline function returns a decimal instead of an integer.
 

Diagnoses


Day Difference returns a decimal by default. The whole number is the number of days, the decimal represents the number of hours.
 

Resolution

To work around the decimal return, you can use the "Round Up" Mathematical inline function. To return a whole number, enter 0 digits. The number will be rounded up into the next integer.

In your project, you will use the "Round Up" function and in the "Value" field you will then input the Day Difference function and complete that as normal. In "Digits" for the Round Up function, you will put 0. This will return 7 days, instead of 7.291...... etc.

If you do not want a couple hours left on an item to show as a full additional day (for instance you would rather show 7 days if the number is 7.291 instead of 78 days), you can use the "To Integer" conversion function instead of the Round Up mathematical function. This function performs basic mathematical rounding. Anything below x.5 will return as x. Anything above x.5 will return as the next higher number.




 
Be the first to reply!

Reply