aitoa.format.number.markdown: Format a Number for Presentation in Markdown

Description Usage Arguments Value

View source: R/format_numbers.R

Description

Format a number such that it can suitably be presented in Markdown text.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
aitoa.format.number.markdown(
  n,
  finite.preprocessor = identity,
  real.preprocessor = identity,
  integer.preprocessor = real.preprocessor,
  format.large = aitoa.format.large.number,
  format.small = aitoa.format.small.number,
  format.fraction = aitoa.format.fractional.number,
  const.na = "N/A",
  const.p.inf = "$\\infty$",
  const.n.inf = "$-\\infty$",
  const.0 = "0",
  const.1 = "1",
  const.m1 = "-1"
)

Arguments

n

the number

finite.preprocessor

a function applied to all finite numbers

real.preprocessor

a function applied to all real numbers

integer.preprocessor

a function applied to all integer numbers

format.large

a formatter for large numbers (larger than 10'000'000'000 in absolute value)

format.small

a formatter for numbers which are small

format.fraction

a formatter for fractional numbers in (-1, 1)

const.na

the string constant for NA

const.p.inf

the string constant for positive infinity

const.n.inf

the string constant for negative infinity

const.0

the string constant for 0

const.1

the string constant for 1

const.m1

the string constant for -1

Value

a string representation of the number


thomasWeise/aitoaEvaluate documentation built on Dec. 6, 2020, 1:22 p.m.