The ok
is there to tell you that the call worked. The spec for the function io:format specifies this.
The real problem here is that you are seeing a mixture of the erlang terminal, and whatever is comming from stdout - stdout is printing the numbers, and the erlang terminal is giving back the ok
.
if you were writing a script using escript, the ok stratement will not be printed to standart output - you should simply think of the console as an interactive interpreter.
As a side note the easiest way to output:
123
456
789
Would be
1> 123. 456. 789.
123
456
789