Print an obelus

obelus(numerator = "", denominator = "", format = NA, contract = F)

Arguments

numerator

Character. If the obelus separates two strings, the first one.

denominator

Character. If the obelus separates two strings, the second one.

format

Function. If provided, formats numerator and denominator.

contract

Logical. Remove spaces?

Value

Character. The numerator and denominator (if provided), formatted if necessary, separated by an obelus (UTF-8).

obelus is a wrapper for glue, so you can use curly bracket notation in numerator and denominator, just like with glue.

Examples

library(scales) obelus()
#> [1] "÷"
obelus(1234, 5678)
#> 1234 ÷ 5678
obelus(1234, 5678, format = comma)
#> 1,234 ÷ 5,678
obelus(1234, 5678, format = comma, contract = TRUE)
#> 1,234÷5,678