This below by Axel Vogt posted on sci.math.symbolic which does a nice job of
formatting output to specific width.
split_for_print:=proc(expr, len) # expr = some Maple expression # len = length to split with line breaks local L,s,tmp,j; s:=convert(expr, string); L:=[StringTools:-LengthSplit(s, len)]; for j from 1 to nops(L) do # if j = nops(L) then printf("%s ;", L[-1]) if j = nops(L) then printf("%s", L[-1]) else printf("%s\\\n", L[j]); end if; end do: end proc; evalf[100](Pi); split_for_print(%, 40); 3.14159265358979323846264338327950288419\ 7169399375105820974944592307816406286208\ 998628034825342117068