format_numbers: Pad Numeric Values to be the Same Length

View source: R/S03_Utilities.R

format_numbersR Documentation

Pad Numeric Values to be the Same Length

Description

Function that pads numeric values to be the same length by adding spaces to the left-hand side and trailing zeros after the decimal place.

Usage

format_numbers(x)

Arguments

x

A numeric vector.

Value

A character vector.

Examples

# Decimal values
message( paste0( format_numbers( round( rnorm( 3 ), 2 ) ), "\n" ) )
# Whole numbers
message( paste0( format_numbers( rbinom( 3, 100, .1 ) ), "\n" ) )


rettopnivek/arfpam documentation built on Oct. 20, 2024, 7:24 p.m.