I think the way is to overload print
:
julia> struct PiF
x
end
julia> function Base.show(io::IO, x::PiF)
y = rationalize(x.x/π)
print("($(y.num)/$(y.den))π")
end
julia> function Base.print(stdout::IO,x::AbstractVector{PiF})
print("[")
for i in firstindex(x):lastindex(x)-1
print("$(x[i]), ")
end
print(" $(x[end])]")
end
julia> println(v)
[(2/3)π, (1/3)π, (1/4)π ]
julia> print(v)
[(2/3)π, (1/3)π, (1/4)π ]