time_digits: Compute Digits Needed for Quarter Hour Time Vector

Description Usage Arguments Value Examples

View source: R/time_digits.R

Description

This tool computes the minimum number of digits required for a vector of times. The defaults of the tool assumes your time is rounded to within the quarter hour.

Usage

1

Arguments

x

A numeric vector of times rounded tot he nearest quarter hour.

...

ignored

Value

Returns integer 0-2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
time_digits(c(.5, .25, 6))
time_digits(c(.5, 3.5, 6))
time_digits(c(5, 25, 6))

x <- c(.5, .25, 6)
numform::f_pad_left(numform::f_num(x, digits = numform::time_digits(x)))

lapply(
    list(quarter = c(.5, .25, 6), half = c(.5, 3.5, 6), hour = c(5, 25, 6)),
    function(x) {numform::f_pad_left(numform::f_num(x, digits = numform::time_digits(x)))}
)

numform documentation built on Oct. 10, 2021, 1:10 a.m.