How to make a GUI Label always in the center

I have a gui label that shows one of my int variables, but when it gets to the points where it adds another digit, it is no longer centered. Is there anyway to have it always be centered without writing everything out?

If the label is the only element in the row, choose a fixed width size for it and assign a GUIStyle that has Alignment=MiddleCenter and then (if you’re not using GUILayout) write it at X position: (Screen.width-yourFixedWidth)/2

PS: if it’s displayed inside a GUILayout Area or a GUI Box then replace “Screen.width” with your area/box width