This is a convenience function around [DT::formatRound()] that identifies all of the numeric columns and rounds them, as opposed to just rounding prespecified columns.

roundDT(x, digits = 3)

Arguments

x

a DT::datatable

digits

the number of digits to round. If NA, then no rounding is performed

Value

a rounded DT::datatable

Examples

df <- data.frame(a=rnorm(10), b=sample(letters, 10), c=rnorm(10))
roundDT(DT::datatable(df),  digits=2)