rstudio/gt

`cols_align_decimal()` does not work for scientific numbers

Open

#1,672 opened on May 21, 2024

View on GitHub
 (0 comments) (0 reactions) (1 assignee)R (222 forks)batch import
Difficulty: [2] IntermediateEffort: [2] MediumFocus: HTML OutputGood First IssuePriority: [3] HighType: ☹︎ Bug

Repository metrics

Stars
 (2,146 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

When I apply cols_align_decimal() to a column that was formated using fmt_scientific(), the decimal point is not aligned (for rows where the power of 10 part is missing).

Reprex:

library(gt)
exibble["num"] |>
  gt() |>
  fmt_scientific() |>
  cols_align_decimal()

image

Contributor guide