fmtN: Convert a decimal number into exactly n decimal places.

View source: R/fmtN.R

fmtNR Documentation

Convert a decimal number into exactly n decimal places.

Description

Convert a decimal number into exactly n decimal places without scientific notation.

Usage

fmtN(x,n)

Arguments

x,n

where x is a decimal number and n is the numbers of decimal places to keep.

Details

Round a decimal number into exactly n decimal places.

Value

A decimal number rounded into exactly n decimal places.

See Also

fmt4 is a special case of fmtN but is simpler to use with one argument.

Examples

x <- sin (sample(c(1:5),1))
n <- sample(c(4:10),1)

fmtN(x,n)


Tex4exams documentation built on May 31, 2023, 8:04 p.m.

Related to fmtN in Tex4exams...