sn: LaTeX code for scientific notation

Description Usage Arguments Author(s) Examples

Description

This function will return LaTeX code for scientific notation of it's input, taken from my answer on Stackoverflow (http://stackoverflow.com/a/8367233/567015).

Usage

1
sn(x, digits)

Arguments

x

Number to be formatted

digits

Number of digits to be displayed

Author(s)

Sacha Epskamp <mail@sachaepskamp.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Example in Sweave:
## Blablabla this is a pretty formatted number $\Sexpr{sn(0.00134,2)}$.

## Some examples:
sn(2000000)
sn(0.001)
sn(0.00005)
sn(10.1203)
sn(-0.00013)
sn(0)

SachaEpskamp/staTeX documentation built on May 9, 2019, 12:10 p.m.