Posted 10 October 2014 - 11:37 PM
Using CC 1.5
I have code that writes a number to a monitor, example:
mon = peripheral.wrap("top")
i=1
mon.write(i)
However, instead of writing "1" it insists on writing "1.0"
On playing about on the interactive Lua prompt I have found that a raw write seems to perform as expected.
lua> term.write(i) -> 1.0
lua> write(i) -> 1
With that said I have found a workaround that seems to work, but the nature of this seems odd:
term.write(i.."") -> 1
Can someone make sense of this for me, and educate me how to write integers correctly. PS, I have also tried math.floor with no effect.
TIA
I have code that writes a number to a monitor, example:
mon = peripheral.wrap("top")
i=1
mon.write(i)
However, instead of writing "1" it insists on writing "1.0"
On playing about on the interactive Lua prompt I have found that a raw write seems to perform as expected.
lua> term.write(i) -> 1.0
lua> write(i) -> 1
With that said I have found a workaround that seems to work, but the nature of this seems odd:
term.write(i.."") -> 1
Can someone make sense of this for me, and educate me how to write integers correctly. PS, I have also tried math.floor with no effect.
TIA