The prefix is causing an infinite loop, try with something like this.
library(shiny)
library(stringr)
library(scales)
ui <- fluidPage(
mainPanel(
textInput("inp1", label = "Total", value = "110000")
)
)
server <- function(input, output, session) {
observe({
if (!str_detect(input$inp1, "S ")) {
updateTextInput(session, "inp1", "Total",
value = number(as.numeric(input$inp1), prefix = "S ", big.mark = ","))
}
})
}
shinyApp(ui = ui, server = server)