@@ -4880,6 +4880,50 @@ get_letters_from_div <- function(x, set) {
4880
4880
# ' `r man_get_image_tag(file = "man_fmt_spelled_num_2.png")`
4881
4881
# ' }}
4882
4882
# '
4883
+ # ' Let's make a table that compares how the numbers from `1` to `10` are spelled
4884
+ # ' across a small selection of languages. Here we use `fmt_spelled_num()` with
4885
+ # ' each column, ensuring that the `locale` value matches that of the column
4886
+ # ' name.
4887
+ # '
4888
+ # ' ```r
4889
+ # ' dplyr::tibble(
4890
+ # ' num = 1:10,
4891
+ # ' en = num,
4892
+ # ' fr = num,
4893
+ # ' de = num,
4894
+ # ' es = num,
4895
+ # ' pl = num,
4896
+ # ' bg = num,
4897
+ # ' ko = num,
4898
+ # ' zh = num
4899
+ # ' ) |>
4900
+ # ' gt(rowname_col = "num") |>
4901
+ # ' fmt_spelled_num(columns = en, locale = "en") |>
4902
+ # ' fmt_spelled_num(columns = fr, locale = "fr") |>
4903
+ # ' fmt_spelled_num(columns = de, locale = "de") |>
4904
+ # ' fmt_spelled_num(columns = es, locale = "es") |>
4905
+ # ' fmt_spelled_num(columns = pl, locale = "pl") |>
4906
+ # ' fmt_spelled_num(columns = bg, locale = "bg") |>
4907
+ # ' fmt_spelled_num(columns = ko, locale = "ko") |>
4908
+ # ' fmt_spelled_num(columns = zh, locale = "zh") |>
4909
+ # ' cols_label_with(fn = function(x) md(paste0("`", x, "`"))) |>
4910
+ # ' tab_spanner(
4911
+ # ' label = "Numbers in the specified locale",
4912
+ # ' columns = everything()
4913
+ # ' ) |>
4914
+ # ' cols_align(align = "left", columns = everything()) |>
4915
+ # ' cols_width(
4916
+ # ' c(en, fr, de, es, pl, bg) ~ px(100),
4917
+ # ' c(ko, zh) ~ px(50)
4918
+ # ' ) |>
4919
+ # ' opt_horizontal_padding(scale = 2) |>
4920
+ # ' opt_vertical_padding(scale = 0.5)
4921
+ # ' ```
4922
+ # '
4923
+ # ' \if{html}{\out{
4924
+ # ' `r man_get_image_tag(file = "man_fmt_spelled_num_3.png")`
4925
+ # ' }}
4926
+ # '
4883
4927
# ' @family data formatting functions
4884
4928
# ' @section Function ID:
4885
4929
# ' 3-11
@@ -8655,13 +8699,13 @@ fmt_units <- function(
8655
8699
# ' automatically stylized to fit conventions; `"NO_x"` and `"x Na(NH4)HPO4"`
8656
8700
# ' will have italicized 'x' characters and you can always italicize letters
8657
8701
# ' by surrounding with `"*"` (as in `"*n* H2O"` or `"*n*-C5H12"`)
8658
- # ' - Chemical isotopes can be rendered using either of these two construction
8702
+ # ' - Chemical isotopes can be rendered using either of these two constructions
8659
8703
# ' preceding an element: `"^{227}_{90}Th"` or `"^227_90Th"`; nuclides can
8660
8704
# ' be represented in a similar manner, here are two examples:
8661
8705
# ' `"^{0}_{-1}n^{-}"`, `"^0_-1n-"`
8662
8706
# ' - Chemical reactions can use `"+"` signs and a variety of reaction arrows:
8663
- # ' (1) "A -> B", (2) "A <- B", (3) "A <-> B", (4) "A <--> B", (5) "A <=> B",
8664
- # ' (6) "A <=>> B", or (7) "A <<=> B"
8707
+ # ' (1) ` "A -> B"` , (2) ` "A <- B"` , (3) ` "A <-> B"` , (4) ` "A <--> B"` , (5)
8708
+ # ' `"A <=> B"`, (6) ` "A <=>> B"` , or (7) ` "A <<=> B"`
8665
8709
# ' - Center dots (useful in addition compounds) can be added by using a single
8666
8710
# ' `"."` or `"*"` character, surrounded by spaces; here are two equivalent
8667
8711
# ' examples `"KCr(SO4)2 . 12 H2O"` and `"KCr(SO4)2 * 12 H2O"`
0 commit comments