julia> using Printf
julia> a = 1;
julia> @printf("%.3f\n", a)
1.000
There’s also @sprintf
to get a string value, see Printf · The Julia Language for details.
julia> using Printf
julia> a = 1;
julia> @printf("%.3f\n", a)
1.000
There’s also @sprintf
to get a string value, see Printf · The Julia Language for details.