Learn R Programming

table.glue (version 0.0.5)

format_big: Format values left of decimal

Description

Values to the left of the decimal are generally called 'big' since they are larger than values to the right of the decimal. format_big() lets you update the settings of a rounding_specification object (see round_spec) so that values left of the decimal will be printed with a specific format (see examples).

Usage

format_big(rspec, mark = ",", interval = 3L)

Value

an object of class rounding_specification.

Arguments

rspec

a rounding_specification object (see round_spec).

mark

a character value used to separate number groups to the left of the decimal point. See prettyNum for more details on this. Set this input to '' to negate it's effect.

interval

a numeric value indicating the size of number groups for numbers left of the decimal.

Examples

Run this code

big_x <- 1234567

rspec <- format_big(round_spec(), mark = '|', interval = 3)

table_value(big_x, rspec) # returns "1|234|567"

Run the code above in your browser using DataLab