Prints numbers nicely formatted, with optional units. Primarily for internal use in text processing of knitr output. Not usually referenced by the user.
Usage
xP(x, d=NULL, unit=NULL, semi=FALSE)
Arguments
x
The variable.
d
The digits.
unit
Unit of measurement for the variable.
semi
Add a semicolon before the unit to add some horizontal spacing
in math mode.
Details
Input is numeric, output is formatted text. A special unit is "$", which is added to the front of the number instead of as a trailing descriptor.