613-518-1166 info@zimdatabases.com

Developing ZIM Applications

How To Take Advantage of Rounding

< All Topics

The results of value expressions are rounded automatically, but only after the entire expression has been evaluated. (During evaluation, full decimal values are used.)

The final result takes on the number of decimal places found in the operand with the most decimal places.

The rounded result is further rounded if it is being assigned to a named constant, a variable, a field, or a form field defined to contain fewer decimal places.

To force rounding in particular circumstances, use the $round function.

Examples of Rounding

5/2

Result is 3.

5/2.0

Result is 2.5.

1+1.01

Result is 2.01.

1.01+(5/2)

Result is 3.51.

Integer=1.01+(5/2)

Result is 4 if Integer is defined to contain no decimal places.

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Table of Contents