force_or_cut | R Documentation |
Print a number having a specified number of digits or as integer
force_or_cut(x, decimals = 2)
x |
A vector of numbers |
decimals |
The number of digits that should be printed if x is a decimal number. Defaults to 2. |
If x integer, only the integer is printed, if x is a decimal number, the decimals are printed
Character vector of length length(x)
. The number(s) in the required format.
Martin Papenberg martin.papenberg@hhu.de
force_or_cut(c(1:3, 1.23456, 0.873, 2.3456))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.