I added rounding as a default because I found myself writing "{round(p, 2)}" literally every time I did a projection. On net I think it saves more typing having the default this way rather than having .digits=NULL by default.
One thing that would be neat though is to deprecate the .digits argument and replace with a .format argument which accepts a formatting function (i.e. a one place function that accepts a string and returns a string). By default .format = round_transformer but then you could write .format = srcreporting::dec_dig3
@paddytobias You can turn off rounding by setting
digits=NULL
. TryI added rounding as a default because I found myself writing
"{round(p, 2)}"
literally every time I did a projection. On net I think it saves more typing having the default this way rather than having.digits=NULL
by default.One thing that would be neat though is to deprecate the
.digits
argument and replace with a.format
argument which accepts a formatting function (i.e. a one place function that accepts a string and returns a string). By default.format = round_transformer
but then you could write.format = srcreporting::dec_dig3
Originally posted by @kinto-b in https://github.com/socialresearchcentre/projectable/issues/30#issuecomment-1139260506