cn: Customizable Number Aware String

Description Usage Arguments Value sprintf-like types See Also Examples

Description

Customizable Number Aware String

Usage

1
2
cn(n, one = "there %r %n value%s", some = one, none = some,
  lots = some, nlots = 10)

Arguments

n

A count of the number.

one

The string to return if n = 1

some

The string to return if n is in 2, 3, ..., nlots - 1

none

The string to return if n = 0

lots

The string to return if n >= nlots

nlots

A count of the number of values to consider to be lots

Value

A string of the updated message.

sprintf-like types

The following sprintf-like types can be used in the custom messages:

n

the length of the object

s

's' if n != 1 otherwise ”

See Also

cc and co

Examples

1
2
3
cn(0)
cn(1)
cn(4)

err documentation built on May 2, 2019, 3:07 p.m.

Related to cn in err...