The TPosition
property of FMX controls is stored in floating point, not integer, format. There is no need to use integer division.
lblID.Position.X := 0.5*(MainForm.Width - lblID.Width);
You should probably also review :
For example :
lblID.Align := alHorzCenter;
may give you want you want. Adusting the Padding
property will allow for vertical placement of the control while alHorzCenter
will keep the control horizontally centered.