我创建了一个在 valueBox 中显示值的闪亮应用程序。这些值应该以相应的货币($ 或 € 或 £)显示,但是,仅显示 $ 符号。
MWE 如下所示:
library(shinydashboard)
library(shiny)
ui <- dashboardPage(
dashboardHeader(title = "MWE"),
dashboardSidebar(),
dashboardBody(
fluidRow(
valueBox(value = paste0(sprintf("%.2f", 123.14), "$"),
subtitle = "This works good:",
color = "green"),
valueBox(value = paste0(sprintf("%.2f", 123.14), "€"),
subtitle = "This does not work:",
color = "red")
)
)
)
server <- function(input, output) {
}
shinyApp(ui, server)
有任何想法吗?