decimals_only: Printing a specified number of decimals and ignore leading...

View source: R/print_only_decimals.R

decimals_onlyR Documentation

Printing a specified number of decimals and ignore leading zeros

Description

Printing a specified number of decimals and ignore leading zeros

Usage

decimals_only(x, decimals = 2, decimals1 = FALSE)

Arguments

x

the values to be printed

decimals

how many decimals are to be printed. Defaults to 2.

decimals1

Boolean - should a value of exactly 1 be converted to 1.00. Defaults to FALSE.

Value

Character vector of length length(x). The number(s) in the required format.

Author(s)

Martin Papenberg martin.papenberg@hhu.de

Examples


decimals_only(c(0.23456, 0.873, 0.3456), decimals = 3)


m-Py/prmisc documentation built on March 29, 2025, 2:30 p.m.