nthDecimalDigit: Returns the nth decimal digit from the number x

Description Usage Arguments Value Examples

View source: R/utility_functions.R

Description

Returns the nth decimal digit from the number x

Usage

1
nthDecimalDigit(x, position)

Arguments

x

input number

position

can be between 0 and ~ +20

Value

the number at the decimal position

Examples

1
2
x <- 1234.1234567
floor((x * 10^5) %% 10)

alesaccoia/alexr documentation built on Dec. 19, 2021, 12:26 a.m.