format_num: format_num

View source: R/format_num.R

format_numR Documentation

format_num

Description

Formats numbers to the finnish standard.

Usage

format_num(
  x,
  digits = 1,
  format = "f",
  dec = ",",
  flag = "",
  big.mark = " ",
  ...
)

Arguments

x

an atomic numerical or character object, typically a vector of real numbers. Any class is discarded, with a warning.

digits

the desired number of digits after the decimal point (format = "f") or significant digits (format = "g", = "e" or = "fg"). If digits is negative, then round to numbers like tens, hundreds or thousands.

dec

he character to be used to indicate the numeric decimal point.

flag

for formatC, a character string giving a format modifier as in Kernighan and Ritchie (1988, page 243) or the C+99 standard. For example "0" pads leading zeros; "-" does left adjustment; "+" ensures a sign in all cases, i.e., "+" for positive numbers

big.mark

used as mark between every big.interval decimals before the decimal point.

...

add other parameters to formatC like width and small.mark

Examples

x <- seq(0, 10, by = 0.01)
format_num(x)

JouniVatanen/stools documentation built on Jan. 25, 2023, 8:49 p.m.