doomlab/MOTE

Setting `decimals = 0` no longer works in `apa()`

isaactpetersen opened this issue · 0 comments

Due to a change in R 4.1, the format() function no longer allows setting decimals = 0: https://stackoverflow.com/a/70674065/2029527. This leads to an error in the apa() function. It'd be nice to allow printing an integer when setting decimals = 0 in the apa() function.

> apa(84.5, decimals = 1)
[1] "84.5"
> apa(84.5, decimals = 0)
Error in prettyNum(.Internal(format(x, trim, digits, nsmall, width, 3L,  : 
  invalid value 0 for 'digits' argument