How to specify the format for printing an array of Floats in julia?
16:24 07 Aug 2016

I have an array or matrix that I want to print, but only to three digits of precision. How do I do that. I tried the following.

> @printf("%.3f", rand())
0.742

> @printf("%.3f", rand(3))
LoadError: TypeError: non-boolean (Array{Bool,1}) used in boolean context 
while loading In[13], in expression starting on line 1

Update: Ideally, I just want to call a function like printx("{.3f}", rand(m, n)) without having to further process my array or matrix.

printf julia