format_num: Format numeric value to add marks

View source: R/format_num.r

format_numR Documentation

Format numeric value to add marks

Description

Format value to add a thousand and decimal mark.

Usage

format_num(
  x,
  digits = 2,
  decimal_mark = ".",
  thousand_mark = ",",
  br_mark = FALSE
)

Arguments

x

A numeric vector

digits

A numeric integer single value (default = 2), that will be the number of decimal digits

decimal_mark

A character single value to use as the decimal mark (default = '.')

thousand_mark

A character single value to use as the thousand mark (default = ',')

br_mark

A boolean value, if TRUE the function will set decimal_mark = ',' and thousand_mark = '.' (default = FALSE)

Value

A character vector with the formatted vector.

Examples


format_num(12345.67)


vbfelix/relper documentation built on May 10, 2024, 10:50 p.m.