Uniformly set floating point sig digits in a code

For the whole REPL session, you can redefine the show function. Next REPL will be back to normal.

julia> using Printf

julia> Base.show(io::IO, f::Float64) = @printf(io, "%.4f", f)

julia> rand(5,5)
5×5 Matrix{Float64}:
 0.3295  0.7265  0.5993  0.5268  0.8041
 0.8736  0.8861  0.2600  0.9450  0.2365
 0.4777  0.1362  0.2872  0.1366  0.4631
 0.0829  0.5563  0.2298  0.9434  0.2490
 0.4327  0.0836  0.2727  0.8882  0.4711
2 Likes