statistikZH / statR

ZH-color-scheme & theme_stat template for ggplot2.
https://statistikzh.github.io/statR/
GNU General Public License v3.0
15 stars 1 forks source link

decimals are not shown in excel #20

Closed ThomasKnecht closed 3 years ago

ThomasKnecht commented 3 years ago

When I create an excel with the splitXLSX function, one column should have decimals but they are not shown.

The cell format in the excel is the following: ##'##0 even though in the function the cell format is set as: #,###0

statR-Version: 1.0.0.9999 R-Version: 4.0.4

tlorusso commented 3 years ago

I've now removed the global formatting option ##'##0 (dev branch), which was a bad idea in the first place.

I suggest adding examples of how individual formatting of the columns is possible to the documentation. Or would you prefer adding an argument to the function that allows handling column formats? @ThomasKnecht

This works:

class(mtcars$mpg) <- "currency"
class(mtcars$cyl) <- "accounting"
class(mtcars$qsec) <- "hyperlink"
class(mtcars$am) <- "percentage"
class(mtcars$vs) <- "scientific"

quickXLSX(mtcars, "mtcars",metadata=c("1","2"))