0

I don't want scientific notation in my R shiny. I tried to put options(scipen=999) in both UI and server. However, when display locally it shows non-scientific number while published to server it changed to scientific notation.

I'm using R 4.0.3 and try to display a R data.table in the app. Tried converting all numbers using format it failed as well. Thinking there may be a better way to handle this.

 output$omop <- renderDataTable(
    labtable() %>% datatable(extensions = c("FixedHeader",'Buttons'),
                                        options = list(dom = 'Blfrtip',
                                        buttons = c('csv', 'excel', 'pdf', 'print'),
                                         lengthMenu = list(c(10,50,-1),
                                                           c(10,50,"All"))))
  )

Are there options I can add or modify to prevent this unwanted display happen?

Thanks!

Stéphane Laurent
  • 75,186
  • 15
  • 119
  • 225
ponyhd
  • 491
  • 1
  • 4
  • 19
  • Put one of the JavaScript functions found [here](https://stackoverflow.com/questions/1685680/how-to-avoid-scientific-notation-for-large-numbers-in-javascript) in the header and use it with `rowCallback`. – Stéphane Laurent Dec 13 '22 at 16:01

0 Answers0