DescTools (version 0.99.8.1)

Frac: Return the Fractional Part of a Numeric Value

Description

Return the fractional part of a numeric value.

Usage

Frac(x, dpwr = NA)

Arguments

x
the numeric value (or a vector of numerics), whose fractional part is to be calculated.
dpwr
if dpwr is not missing, the fractional part will be multiplied by 10^dpwr and returned rounded to integer. Defaults to NA.

Value

  • return the fractional part of x.

See Also

Ndec

Examples

Run this code
x <- rnorm(5)*100
x
Frac(x)

# multiply by 10^4
Frac(x, dpwr=4)

Run the code above in your browser using DataCamp Workspace