julia> using Printf julia> @printf "pi=%4.2f e=%4.2e" pi exp(1) pi=3.14 e=2.72e+00 julia> @printf("pi=%4.2f e=%4.2e", pi, exp(1)) pi=3.14 e=2.72e+00 julia> s=@sprintf "pi=%4.2f e=%4.2e" pi exp(1) "pi=3.14 e=2.72e+00" julia> s "pi=3.14 e=2.72e+00" julia> out=open("output.dat","w") IOStream(<file output.dat>) julia> @printf(out,"pi=%4.2f e=%4.2e\n", pi, exp(1)) julia> close(out) julia> run(`cat output.dat`) pi=3.14 e=2.72e+00 Process(`cat output.dat`, ProcessExited(0)) |