format_small: Format values right of decimal

View source: R/round_spec.R

format_smallR Documentation

Format values right of decimal

Description

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

Usage

format_small(rspec, mark = "", interval = 5L)

Arguments

rspec

a rounding_specification object (see round_spec).

mark

a character value used to separate number groups to the right 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.

Value

an object of class rounding_specification.

See Also

Other formatting helpers: format_decimal()

Examples


small_x <- 0.1234567

rspec <- round_spec()
rspec <- round_using_decimal(rspec, digits = 7)
rspec <- format_small(rspec, mark = '*', interval = 1)

table_value(small_x, rspec)


table.glue documentation built on Feb. 16, 2023, 9:29 p.m.