Convert a decimal number into exactly n decimal places without scientific notation.
fmtN(x,n)
A decimal number rounded into exactly n decimal places.
where x is a decimal number and n is the numbers of decimal places to keep.
Round a decimal number into exactly n decimal places.
fmt4
is a special case of fmtN but is simpler to use with one argument.
x <- sin (sample(c(1:5),1))
n <- sample(c(4:10),1)
fmtN(x,n)
Run the code above in your browser using DataLab