Round
Previous  Top  Next

Prototype

IntNumber:=Round(floatNumber)

Description

It rounds a real number as the nearer integer.

Parameters

FloatNumber: real number to be rounded.

Returned value

IntNumber: integer obtained by rounding.

Notes

None.

Example

// It stores the table handle 
UnaTabella:= TableOpen('c:\documents\index','statistics.db');

//It makes a division
Quotient:= 89/14;

//It rounds the quotient (6)
QuotInt:=Round(Quotient);

//It converts into string
QuotIntStr:=IntToStr(QuotInt);

//It sets the current record edit mode 
TableEdit(UnaTabella);

// It changes the field value
TableSetFieldByName(UnaTabella, 'Result', QuotIntStr);

//It confirms the change
TablePost(UnaTabella);

// It executes other operations

//  It closes the table
TableClose(UnaTabella);