format_num {cocoon}R Documentation

Format numbers

Description

Format numbers

Usage

format_num(x, digits = 1, pzero = TRUE)

Arguments

x

Number.

digits

Number of digits after the decimal.

pzero

Logical value (default = TRUE) for whether to include leading zero numbers less than 1.

Value

A character string formatting the number with specified number of digits after the decimal.

Examples

format_num(pi, digits = 2)
format_num(pi, digits = 4)

[Package cocoon version 0.2.0 Index]