fastreport

Round to upper integer in Fast-Report VCL


I want to round decimal value to upper integer, for example

10.25 = 11
30.79 = 31
1.1 = 2

The round function in Fast-Report will round to nearest not the upper integer.

I'm using PascalScript language for Fast-Report coding.


Solution

  • Ceiling returns the smallest integer greater than or equal to d.

    Example:

    Ceiling(1.7) = 2

    If not available you could try this workaround:

    x = 1.1

    Round(x+0.49) = 2