How to specify the format for printing an array of Floats in julia?
<p>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.</p>

<pre><code>&gt; @printf("%.3f", rand())
0.742

&gt; @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
</code></pre>

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