Skip to content

HTML currency columns default to letters rather than currency symbol #1384

@plukethep

Description

@plukethep

Description

I'm making an interactive table in HTML with currency columns, but when you include tab_options the currency defaults to the letters rather than the symbols

Reproducible example

If you try and use fmt_currency, this acts as expected

library(tidyverse)
library(gt)
starwars %>% select(name, birth_year) %>%
  gt() %>%
  fmt_currency(columns=birth_year,currency = "GBP")

But if you try and add tab_options, then the £ symbol disappears and it changed to GBP

library(tidyverse)
library(gt)
starwars %>% select(name, birth_year) %>%
  gt() %>%
  fmt_currency(columns=birth_year,currency = "GBP") %>%
  tab_options(ihtml.active = TRUE,
              ihtml.use_filters = TRUE)

Session info

#> R version 4.3.1 (2023-06-16 ucrt)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 19045)
#>
#> Matrix products: default
#>
#>
#> locale:
#> [1] LC_COLLATE=English_United Kingdom.utf8
#> [2] LC_CTYPE=English_United Kingdom.utf8
#> [3] LC_MONETARY=English_United Kingdom.utf8
#> [4] LC_NUMERIC=C
#> [5] LC_TIME=English_United Kingdom.utf8
#>
#> time zone: Europe/London
#> tzcode source: internal
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] styler_1.10.1 digest_0.6.32 fastmap_1.1.1 xfun_0.39
#> [5] magrittr_2.0.3 glue_1.6.2 R.utils_2.12.2 knitr_1.43
#> [9] htmltools_0.5.5 rmarkdown_2.23 lifecycle_1.0.3 cli_3.6.1
#> [13] R.methodsS3_1.8.2 vctrs_0.6.3 reprex_2.0.2 withr_2.5.0
#> [17] compiler_4.3.1 R.oo_1.25.0 R.cache_0.16.0 purrr_1.0.1
#> [21] rstudioapi_0.14 tools_4.3.1 evaluate_0.21 yaml_2.3.7
#> [25] rlang_1.1.1 fs_1.6.2

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions