n_decimals: Restrict the number of decimals places for a numeric value

Description Usage Arguments Value Author(s) Examples

View source: R/n_decimals.R

Description

Restrict the number of decimals places for a numeric value

Usage

1
n_decimals(x, n)

Arguments

x

a numeric vector

n

number of decimals

Value

a numeric vector

Author(s)

Daniel Gardiner (daniel.gardiner@phe.gov.uk)

Examples

1
2
3
4
5
6
7
x = c(1.001, 1.2323221, 1.211111, 1.00001, 1, 2, 3.1, 3.66)

n_decimals(x, 0)

n_decimals(x, 5)

n_decimals(x, 10)

DanielGardiner/EpiFunc documentation built on July 25, 2019, 10:53 p.m.