nice_numbers {businessPlanR}R Documentation

Format numbers in nice layout

Description

Uses format with some customized defaults. It's being called by kable_bpR.

Usage

nice_numbers(
  x,
  prefix,
  suffix,
  digits = 0L,
  width = NULL,
  nsmall = digits,
  space = c(html = " ", latex = "\\,")
)

Arguments

x

The numeric value to format. Can be a single number, numeric vector, matrix, or data frame.

prefix

An optional symbol to prepend, ignored if missing.

suffix

An optional symbol to append, ignored if missing.

digits

See round.

width

See format.

nsmall

See format.

space

Named character vector, a space definition to put between prefix/suffix and value. Defaults to a thin space for both, LaTeX and HTML. If you use provide one character, that one is used regardless of the output environment.

Value

A formatted character string.

Examples

nice_numbers(12345.6789, suffix="€", digits=2)

[Package businessPlanR version 0.1-0 Index]