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.
numeric, the number for which to determine significant figures.
integer, the number of significant figures
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.