pad0: Pad a string or number with zeroes in front.

View source: R/formatting.R

pad0R Documentation

Pad a string or number with zeroes in front.

Description

Given a number or string, pad the front with zeroes up to length len. This function is a simple wrapper for stringr::str_pad(s,width=len,side="left",pad="0").

Usage

pad0(s, len)

Arguments

s

A string or number.

len

Numeric value, length of the final string.

Value

s with zeroes in front.

Examples

pad0(45,4)


BIO-RSG/oceancolouR documentation built on Nov. 3, 2024, 2:03 a.m.