CEIL()

FLOOR()

INT()

ROUND()  (Added Version 6.0.00)

 

Syntax:

       Then: xx=CEIL(num_expr)

"num_expr" is the given number.
"xx" is the resulting value.

Return value is a field of the same edit type and length as num_expr.

NOTE: If the given number is already an integer, the original number is returned.

 

Version Ref: 4.5

Description:

Performs the ceiling function, which given any number, returns the next greater integer.

 

Examples:

Show the difference between FLOOR(), CEIL(), INT(), and converting to an integer:

Try the example with the numbers: -5.6 -5.5 -5.4 5.4 5.5 5.6 and note the differences among the functions.

 

       Then: input popup xx(10,.5) "Enter a number: "

        If: xx = ""

       Then: end

       Then: yy(10,.0) = xx

       Then: msgbox xx & "\nFLOOR:" < FLOOR(xx) & "\nCEIL:" < CEIL(xx)&       "\nINT:" < INT(xx) & "\nrounding:" < yy

 

ROUND(value [, place])

Valid 'place' values are:  ... -3, -3, -1, 0, 1, 2, 3 ...

examples:

aa=round("123.456")         'aa eq 123

aa=round("123.456","1")   'aa eq 123.5

aa=round("123.456","-1")  'aa eq 120