User:Trang Oul/Sandbox/Template:Range/Unsigned

From Basin Wiki
Jump to navigation Jump to search


Usage

{{Range/Unsigned|min|max}}

The template displays an unsigned range using a hyphen as the separator. Negative boundaries are enclosed in parentheses to avoid ambiguity.

Parameters

Parameter Description Default
1 (min) The lower bound of the range.
2 (max) The upper bound of the range.

Behavior

  • Both parameters are displayed as a range separated by a hyphen.
  • Negative values are enclosed in parentheses.
  • Non-negative values are displayed without additional parentheses.
  • The template does not add explicit positive signs.

Examples

Input Result Description
{{Range/Unsigned|1|2}}

(1-2)

Positive range
{{Range/Unsigned|0|2}}

(0-2)

Range starting at zero
{{Range/Unsigned|-1|2}}

((-1)-2)

Negative minimum and positive maximum
{{Range/Unsigned|-1|0}}

((-1)-0)

Negative minimum and zero maximum
{{Range/Unsigned|-2|-1}}

((-2)-(-1))

Negative range