The following R code can be used to format the first four columns of iris data. Wondering how to format all numeric columns rather than giving their names or positions.
library(tidyverse)
library(DT)
iris %>%
datatable() %>%
formatRound(1:4, digits = 2)