Round values for dataset

Here is an example with two values, one rounds down the other rounds up.
I am showing this rounding to four digits after the decimal point rather than five digits, so Julia will display all digits even when showing them in compact mode. To do the same rounding to five digits after the decimal point, just change 4 to 5 in this line: const fractional_digits = 4.

using DataFrames
const fractional_digits = 4
x1 = 2.00004
x2 = 3.99996
xs = [x1, x2]
df = DataFrame(X=xs)
#  the revised `:X` column gets assigned the values
#   in the original `:X` column after rounding
df[!, :X] = round.(df[:, :X], digits=fractional_digits)
# notice the `.` after `round`, the `:` before `X`
#   and notice the use of the keyword `digits`

which when run gives you

julia> using DataFrames
julia> const fractional_digits = 4
4
julia> x1 = 2.00004
2.00004
julia> x2 = 3.99996
3.99996
julia> xs = [x1, x2]
2-element Array{Float64,1}:
 2.00004
 3.99996

julia> df = DataFrame(X=xs)
2×1 DataFrame
 Row │ X
     │ Float64
─────┼─────────
   1 │ 2.00004
   2 │ 3.99996

julia> # notice the `.` after `round`, the `:` before `X`
julia> #  and notice the use of the keyword `digits`
julia> df[!,:X] = round.(df[:,:X], digits=fractional_digits)
2-element Array{Float64,1}:
 2.0
 4.0

julia> df
2×1 DataFrame
 Row │ X
     │ Float64
─────┼─────────
   1 │     2.0
   2 │     4.0

Feel free to ask for an explanation of any part of that.