I find difficult to format numbers with Julia :
b = 1.111111
bb = @printf "test : %5.2f" b
bb
test : 1.11
That is fine.
using PyPlot
annotate(@printf "test : %5.2f" b, xy=[1;1])
test :
type: non-boolean (Array{Bool,1}) used in boolean context
while loading In[16], in expression starting on line 2
That I don't understand since I expect the result of @printf to be a String. So if someone can explain me how I should do what would be
"test : %5.2f" % b
in Python.
And to conclude, here is the weird thing :
b
1
b has been cast to an Int. Would you call that a bug?
I use Julia 0.3.2 with Jupyter 3.1