Closed pflick closed 5 years ago
Yeah, so digits
stands for the number of signigicant digits as in format
. I think you are looking for a mix of digits
and round
, eg:
> pandoc.table(tbl, digits=4, round = 4, keep.trailing.zeros = TRUE)
------- ------- ------- -------- --------
**a** 10.12 9.321 0.1234 82.771
**b** 12.00 1.099 0.9876 4.332
------- ------- ------- -------- --------
Or even more:
> pandoc.table(tbl, digits=5, round = 4, keep.trailing.zeros = TRUE, justify = 'right')
------- -------- -------- -------- ---------
**a** 10.123 9.3210 0.1234 82.7712
**b** 12.001 1.0987 0.9876 4.3321
------- -------- -------- -------- ---------
I hope this helps and closing the ticket for now -- as having no better idea around this, but feel free to come back with suggestions and reopen.
It seems that the digits option in pandoc.table results in the total number of digits, not digits after the decimal. Here is an example:
results in
There doesn't seem to be a way to get x digits after the decimal point if your numbers vary in length. Is this a feature that could be added? Thank you for pander!