Round function for float

I was surprised to see that round(3.14159,2) was no more available in julia 1.0.
Is there any alternative ? (I saw that signif have also disappeared).

signif has been deprecated in favor of the sigdigits keyword argument to round .

See also here.

1 Like

In Julia 0.7, you will get warnings that tell you the new names:

julia> round(3.14159,2)
┌ Warning: `round(x::Number, digits)` is deprecated, use `round(x; digits=digits)` instead.
│   caller = top-level scope at none:0
└ @ Core none:0
3.14

julia> signif(3.14159, 2)
┌ Warning: `signif(x::Number, digits)` is deprecated, use `round(x; sigdigits=digits)` instead.
│   caller = top-level scope at none:0
└ @ Core none:0
3.1
1 Like