I made a shiny-app with the output is here: https://tci123.shinyapps.io/tes5/
In the output the digits of each cells are not the same, and even, some are very long. How to set it so I can get the same digits for shiny data-table ?
my code:
server <- function(input, output, session) {
output <- renderDataTable({
DT::datatable(df,
selection = "single",
filter = 'bottom',
extensions = c('Buttons', 'ColReorder', 'FixedHeader', 'Scroller'),
rownames = FALSE,
options = list(
columnDefs = list(list(targets = c(13,14), visible = FALSE)))) %>%
formatStyle(columns = "Jan",
valueColumns = "jan_goal",
backgroundColor = styleEqual(levels = c(0,1,2),
values = c("#008000","#FFA500","#F00"))) %>%
formatStyle(columns = "Feb",
valueColumns = "feb_goal",
backgroundColor = styleEqual(levels = c(0,1,2),
values = c("#008000","#FFA500","#F00"))) %>%
mutate(across(is.numeric, round, digits = 2))
})#%>%
dplyr::output %>%
mutate(across(is.numeric, round, digits = 2))
output$df <- output
}