format_digit: Format value to complete with zeroes to the left

View source: R/format_digit.r

format_digitR Documentation

Format value to complete with zeroes to the left

Description

Format value to complete with zeroes to the left until a certain size, e.g., considering a size of 2: 1 -> "01".

Usage

format_digit(x, digits = 2)

Arguments

x

A numeric vector

digits

A numeric integer single value (default = 2), that will be the number of length to add zeroes

Value

A character vector with zeroes added to the left to achieve the desired size.

Examples


x <- c(1,4,10,12)

format_digit(x)


vbfelix/relper documentation built on May 10, 2024, 10:50 p.m.