sig_digs: Calculate the number of significant figures in a number...

Description Usage Arguments Value

View source: R/sig_digs.R

Description

Calculate the number of significant figures in an integer or floating point number. NOTE: this function IS NOT vectorized. To run on a vector of numbers, use sapply(x, sigDigs). Assumes that consecutive trailing 0s of integers and leading 0s of decimals are not significant. E.g. sigDigs(10) == 1.

Usage

1

Arguments

n

numeric, the number for which to determine significant figures.

Value

integer, the number of significant figures


mjdufort/miscHelpers documentation built on Sept. 24, 2018, 7:09 p.m.