Skip to contents

Format numbers according to journal requirements

Usage

journal_format(x, n_break = 4, big.mark = ",", ...)

Arguments

x

an integer-vector

n_break

fix number where the formatting sets the break

big.mark

defaults to ",", passed to base::format(big.mark)

...

additional arguments passed to base::format()

Value

an formatted character string

Details

some journal require to format big numbers only from the fifth digit (instead of the fourth) - this functions fixes this

Examples

vec <- c(1L, 20L, 300L, 4000L, 50000L)
journal_format(vec, big.mark = ",")
#> [1] "    1"  "   20"  "  300"  " 4000"  "50,000"