you could just use io_lib:format