English uses ',' between every 3 numbers while the SI format recommends a ' ' if x > 10^4. The scientific form 10e+? is furthermore avoided.

txtInt(
  x,
  language = getOption("htmlTable.language", default = "en"),
  html = getOption("htmlTable.html", default = TRUE),
  ...
)

Arguments

x

The integer variable

language

The ISO-639-1 two-letter code for the language of interest. Currently only English is distinguished from the ISO format using a ',' as the separator.

html

If the format is used in HTML context then the space should be a non-breaking space,  

...

Passed to base::format()

Value

string

See also

Other text formatters: txtMergeLines(), txtPval(), txtRound()

Examples

txtInt(123)
#> [1] "123"

# Supplying a matrix
txtInt(matrix(c(1234, 12345, 123456, 1234567), ncol = 2))
#>      [,1]     [,2]       
#> [1,] "1,234"  "123,456"  
#> [2,] "12,345" "1,234,567"

# Missing are returned as empty strings, i.e. ""
txtInt(c(NA, 1e7))
#> [1] ""           "10,000,000"