force_decimals: Force printing a specified number of decimals for a number

View source: R/print_decimals_specified.R

force_decimalsR Documentation

Force printing a specified number of decimals for a number

Description

Force printing a specified number of decimals for a number

Usage

force_decimals(x, decimals = 2)

Arguments

x

the numeric values to be printed

decimals

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

Value

The number in the required format

Author(s)

Martin Papenberg martin.papenberg@hhu.de

Examples


force_decimals(c(1.23456, 0.873, 2.3456))
force_decimals(c(1.23456, 0.873, 2.3456), 3)


m-Py/prmisc documentation built on Aug. 23, 2023, 1:20 a.m.