1

我尝试运行一些代码,但它们都将数字转换为字符串,所以闪亮无法计算它。有没有办法将 shinyWidgets 包中进度条中的数字显示为钱?

例如:1.000.000,70 雷亚尔/5.000.000,29 雷亚尔

(在我发言的巴西,我们使用点作为千位分隔符,逗号作为小数分隔符)

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
        progressBar(id = "pb1", value = 1000000.70, 
                    total = 5000000.29, status = "info", display_pct = TRUE, striped = TRUE, 
                    title = "DONATION"),

        progressBar(id = "pb2", value = as.numeric(1000000.70, options(scipen=999)), 
                    total = as.numeric(5000000.29, options(scipen=999), status = "info", display_pct = TRUE, striped = TRUE, 
                    title = "DONATION")
)
)
server <- function(input, output) {}

shinyApp(ui = ui, server = server)
4

0 回答 0