setNsmall: Set the nSmall of a number, and convert it to character

View source: R/rmd.util.r

setNsmallR Documentation

Set the nSmall of a number, and convert it to character

Description

set the nsmall, i.e. number of decimal points, of a number, and convert it to character; 1000 separator ',' is added if max(abs(v)) > 999.

Usage

setNsmall(v, nSmall, keepInt)

Arguments

v

(numeric or integer vector) a number vector

nSmall

(integer) nsmall, i.e. number of decimal points, of a number (0 <= nsmall <= 20)

keepInt

(logical, F) if TRUE, don't format integers

Value

(character vector) formatted numbers in character

Note

This is an internal function used in num2formattedStr

See Also

format, num2formattedStr

Examples

setNsmall(c(1.003,2.1),2)

blueskypie/wfr documentation built on Feb. 6, 2024, 4:38 p.m.