Learn R Programming

rdss (version 1.0.14)

format_num: Round and pad a number to a specific decimal place

Description

Round and pad a number to a specific decimal place

Usage

format_num(x, digits = 3)

Value

a character vector of formatted numbers

Arguments

x

Numeric vector

digits

Number of digits to retain

Examples

Run this code

std.error <- c(0.12, 0.001, 1.2)
format_num(std.error)

Run the code above in your browser using DataLab