Skip to content

Commit

Permalink
Fix error in export_tables namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
izaak-jephson committed Sep 9, 2024
1 parent 6e4ce8b commit d0701e0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
26 changes: 13 additions & 13 deletions R/export_tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@ format_columns <- function(wb,
)

}
# Format £ columns
if (str_detect(colnames(table[column]), "[Vv]alue")) {
addStyle(wb, sheet_name,
rows = start_row:end_row,
cols = column,
style = createStyle(numFmt = "£#,##0;-;£0", halign = "right"),
gridExpand = TRUE
# Format GBP columns
if (stringr::str_detect(colnames(table[column]), "[Vv]alue")) {
openxlsx::addStyle(wb, sheet_name,
rows = start_row:end_row,
cols = column,
style = openxlsx::createStyle(numFmt = "£#,##0;-;£0", halign = "right"),
gridExpand = TRUE
)

}
Expand Down Expand Up @@ -247,12 +247,12 @@ format_rows <- function(wb,
)
}
# Format % rows
else if (str_starts(table[[table_row, 1]],"Percentage")) {
addStyle(wb, sheet_name,
rows = sheet_row,
cols = 2:end_col,
style = createStyle(numFmt = "0%;-;0%", halign = "right"),
gridExpand = TRUE
else if (stringr::str_starts(table[[table_row, 1]],"Percentage")) {
openxlsx::addStyle(wb, sheet_name,
rows = sheet_row,
cols = 2:end_col,
style = openxlsx::createStyle(numFmt = "0%;-;0%", halign = "right"),
gridExpand = TRUE
)

}
Expand Down
3 changes: 2 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ You can install the development version of xlsss from [GitHub](https://github.co

``` r
# install.packages("devtools")
devtools::install_github("ScotGovAnalysis/xlsss")
devtools::install_github("ScotGovAnalysis/xlsss",
upgrade = "never")
```

## Getting started
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ You can install the development version of xlsss from

``` r
# install.packages("devtools")
devtools::install_github("ScotGovAnalysis/xlsss")
devtools::install_github("ScotGovAnalysis/xlsss",
upgrade = "never")
```

## Getting started
Expand Down
6 changes: 3 additions & 3 deletions man/xlsss-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d0701e0

Please sign in to comment.