Format numbers according to a specified handler function. Currently supported are sprintf, format and prettyNum.
pubformat(x, digits = 2, nsmall = digits, handler = "sprintf", ...)
Formatted number
numeric vector
number of digits
see handler
String specififying the name of the function which should
perform the formatting. See sprintf
, format
and prettyNum
.
Passed to handler function if applicable, i.e., not to sprintf
.
Thomas A. Gerds <tag@biostat.ku.dk>
sprintf
, format
, prettyNum
pubformat(c(0.000143,12.8,1))
pubformat(c(0.000143,12.8,1),handler="format")
pubformat(c(0.000143,12.8,1),handler="format",trim=TRUE)
pubformat(c(0.000143,12.8,1),handler="prettyNum")
Run the code above in your browser using DataLab