# NOT RUN {
if (interactive()) {
library( shiny )
library( shinyWidgets )
ui <- fluidPage(
tags$h3("Format numbers"),
tags$br(),
noUiSliderInput(
inputId = "form1",
min = 0, max = 10000,
value = 800,
format = wNumbFormat(decimals = 3,
thousand = ".",
suffix = " (US $)")
),
verbatimTextOutput(outputId = "res1"),
tags$br(),
noUiSliderInput(
inputId = "form2",
min = 1988, max = 2018,
value = 1988,
format = wNumbFormat(decimals = 0,
thousand = "",
prefix = "Year: ")
),
verbatimTextOutput(outputId = "res2"),
tags$br()
)
server <- function(input, output, session) {
output$res1 <- renderPrint(input$form1)
output$res2 <- renderPrint(input$form2)
}
shinyApp(ui, server)
}
# }
Run the code above in your browser using DataLab