Reputation: 63
I build a data table and rounded the values to two decimals, the result is good in RStudio.
But in my shiny app, there were zeros added:
I would like to remove these zeros but I didn't find how. How can I obtain this such that it looks similar to RStudio?
Upvotes: 1
Views: 605
Reputation: 389275
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.
Upvotes: 1