powered by
Format numbers according to a specified handler function. Currently supported are sprintf, format and prettyNum.
pubformat(x, digits = 2, nsmall = digits, handler = "sprintf", ...)
numeric vector
number of digits
see handler
String specififying the name of the function which should perform the formatting. See sprintf, format and prettyNum.
sprintf
format
prettyNum
Passed to handler function if applicable, i.e., not to sprintf.
Formatted number
sprintf, format, prettyNum
# NOT RUN { 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