I can format the column of a datatable object like this
library(DT)
datatable(data.frame(Amount=c(1.00, 2.20, 4.15))) %>% formatCurrency(columns='Amount')

But how to do it using renderDataTable()?
library(shiny)
library(DT)
ui <- shinyUI(fluidPage(
DT::dataTableOutput('dtoMyTable')
))
server <- shinyServer(function(input, output){
output$dtoMyTable <- DT::renderDataTable({
data.frame(Amount=c(1.00, 2.20, 4.15))
})
})
shinyApp(ui = ui, server = server)
source
share