You can use the DT::formatRound . To display a list of columns and the number of digits:
library(DT) set.seed(323) data.frame(x=runif(10), y=rnorm(10), z=rpois(10, 1)) %>% datatable() %>% formatRound(columns=c('x', 'y'), digits=3)

Just remember to use DT::renderDataTable in the server function and DT::dataTableOutput in the user interface.
source share