.numformat | R Documentation |
Helper function used in the print method for class LOADINGS and SLLOADINGS.
Strips the 0 in front of the decimal point of a number if number < 1, only
keeps the first digits
number of digits, and adds an empty space in
front of the number if the number is positive. This way all returned strings
(except for those > 1, which are exceptions in LOADINGS) have the same number
of characters.
.numformat(x, digits = 2, print_zero = FALSE)
x |
numeric. Number to be formatted. |
digits |
numeric. Number of digits after the comma to keep. |
print_zero |
logical. Whether, if a number is between [-1, 1], the zero should be omitted or printed (default is FALSE, i.e. omit zeros). |
A formated number
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.