fmt_minus_sign: Format negative numbers with a minus sign

View source: R/formatters.R

fmt_minus_signR Documentation

Format negative numbers with a minus sign

Description

Format negative numbers with a minus sign

Usage

fmt_minus_sign(xs)

Arguments

xs

a vector of numbers or a character vector representing numbers

Details

Negative zero -0, which might happen from aggressive rounding, does not get a minus sign.

Value

the vector with leading hyphens replaced with HTML minus signs (⁠−⁠).

Examples

fmt_minus_sign(c(1, .2, -1, -.2))

# Don't allow zero to be signed
fmt_minus_sign(c(-0, round(-0.001)))

tjmahr/printy documentation built on March 4, 2024, 1:25 a.m.