1

I build a data table and rounded the values to two decimals, the result is good in R :

enter image description here

But in my shiny app, there were zeros added :

enter image description here

I would like to remove these zeros but I didn't find how..

Thank you a lot,

Elise

1 Answer 1

1

You can use formatRound function.

library(DT)
datatable(df) %>% formatRound(c("a", "b"), digits=2)

replace c("a", "b") with the actual column names in your data.

Not the answer you're looking for? Browse other questions tagged or ask your own question.