format.numerics {DTwrappers2}R Documentation

This function formats numeric values with specified rounding and marking options.

Description

This function formats numeric values with specified rounding and marking options.

Usage

## S3 method for class 'numerics'
format(
  x,
  digits = 0,
  big.mark = "",
  big.interval = 3L,
  small.mark = "",
  small.interval = 5L,
  decimal.mark = getOption("OutDec"),
  input.d.mark = decimal.mark,
  preserve.width = c("common", "individual", "none"),
  zero.print = NULL,
  replace.zero = FALSE,
  drop0trailing = FALSE,
  is.cmplx = NA,
  ...
)

Arguments

x

A numeric, integer, or logical vector to be formatted.

digits

The number of digits to round to. Defaults to 0.

big.mark

A character string used as a mark for thousands. Defaults to "".

big.interval

An integer specifying the interval for the big mark. Defaults to 3.

small.mark

A character string used as a mark for small intervals. Defaults to "".

small.interval

An integer specifying the interval for the small mark. Defaults to 5.

decimal.mark

A character string used as a decimal mark. Defaults to the value of getOption("OutDec").

input.d.mark

The decimal mark to be used for input. Defaults to the value of decimal.mark.

preserve.width

A character string specifying how to preserve the width of the output. Can be "common", "individual", or "none". Defaults to "common".

zero.print

A character string to be used for printing zero. Defaults to NULL.

replace.zero

A logical value indicating whether to replace zeros with the zero.print value. Defaults to FALSE.

drop0trailing

A logical value indicating whether to drop trailing zeros. Defaults to FALSE.

is.cmplx

A logical value indicating whether the input is complex. Defaults to NA.

...

Additional arguments passed to prettyNum.

Value

A character vector with formatted numeric values.


[Package DTwrappers2 version 0.0.3 Index]