# Round float with Julia 1.1

**URL:** https://discourse.julialang.org/t/round-float-with-julia-1-1/27683
**Category:** New to Julia
**Created:** [August 18, 2019, 5:26pm UTC](https://discourse.julialang.org/t/round-float-with-julia-1-1/27683 "2019-08-18T17:26:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Luigi\_Marongiu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luigi_marongiu/32/7909_2.png) [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)
#### Post date: [August 18, 2019, 5:26pm UTC](https://discourse.julialang.org/t/round-float-with-julia-1-1/27683/1 "2019-08-18T17:26:46Z")

</div>

Hello, I am trying to round a number to the 3rd decimal with Julia 1.1 but I have issues:

```julia
julia> beta
0.005208333333333333
julia> round(beta, 3)
ERROR: MethodError: no method matching round(::Float64, ::Int64)
Closest candidates are:
  round(::Float64, ::RoundingMode{:Nearest}) at float.jl:370
  round(::Float64, ::RoundingMode{:Up}) at float.jl:368
  round(::Float64, ::RoundingMode{:Down}) at float.jl:366
  ...
Stacktrace:
 [1] top-level scope at none:0
julia> round(beta, Up)
ERROR: UndefVarError: Up not defined
Stacktrace:
 [1] top-level scope at none:0
julia> round(beta, RoundingMode(Up))
ERROR: UndefVarError: Up not defined
Stacktrace:
 [1] top-level scope at none:0
julia> RoundNearest(beta)
ERROR: MethodError: objects of type RoundingMode{:Nearest} are not callable
Stacktrace:
 [1] top-level scope at none:0
julia> round(beta, RoundNearest)
0.0
julia> ceil(beta)
1.0

```

what is the current sintax to round a float to the n digit?

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [August 18, 2019, 5:38pm UTC](https://discourse.julialang.org/t/round-float-with-julia-1-1/27683/2 "2019-08-18T17:38:11Z")

</div>

```julia
julia> round(1.3333333333333333, digits=3)
1.333

```

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [August 18, 2019, 7:54pm UTC](https://discourse.julialang.org/t/round-float-with-julia-1-1/27683/3 "2019-08-18T19:54:00Z")

</div>

You’re probably looking to old documentation? `round(beta, 3)` is an old syntax, before Julia v0.7

---

<div class="post-metadata">

### Author: ![lostella](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lostella/32/356_2.png) [@lostella](https://discourse.julialang.org/u/lostella)
#### Post date: [August 18, 2019, 8:49pm UTC](https://discourse.julialang.org/t/round-float-with-julia-1-1/27683/4 "2019-08-18T20:49:32Z")

</div>

Relevant documentation is [here](https://docs.julialang.org/en/v1/base/math/#Base.round-Tuple%7BType,Any%7D).

To be fair though, [this table about rounding functions](https://docs.julialang.org/en/v1/manual/mathematical-operations/#Rounding-functions-1) links to the `TimeType`-related (ie dates) methods for `round`, which is probably a bit confusing. Should this be fixed?
