I was trying to get my logical brain to work again, but I can't seem to wrap my head around this. If I do my logical math, it would like this:
--Size of the monitor
x = 39
y = 26
#text = 8 --#text is that same as string.length(text)
m = peripheral.wrap("right") --Wrapping the monitor
--Calculations
center = math.ceil(39 / 2) = 20 --Half of the monitor
xText = center - (#text / 2) = 20 -4 = 16 --Where the text starts
m.setCursorPos(xText, 1)
m.write(text)
--Controlling the figures
16 + 8 = 24
39 - 24 = 15 --About centered
But still the text looks very off-centered. Any thoughts?