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

From Basin Wiki
Jump to navigation Jump to search

Usage

{{Range/Unsigned|min|max}}

Parameters

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

Behavior

This template formats a range using the two bounds min and max. It expects min to be less than or equal to max.

  • Non-negative range (min ≥ 0): Encloses the range in parentheses, preserving the original parameter order without additional parentheses around the boundaries or explicit positive signs.
  • Non-positive range (max ≤ 0): Encloses the range in parentheses, preserving the original parameter order and additionally enclosing each negative boundary in parentheses.
  • Mixed-sign range (otherwise): Encloses the range in parentheses, preserving the original parameter order and additionally enclosing the negative minimum in parentheses.

Examples

Input Result Description
{{Range/Unsigned|10|30}} (10-30) Both boundaries are positive.
{{Range/Unsigned|0|30}} (0-30) Minimum is zero and maximum is positive.
{{Range/Unsigned|-30|10}} ((-30)-10) Minimum is negative and maximum is positive.
{{Range/Unsigned|-30|0}} ((-30)-0) Minimum is negative and maximum is zero.
{{Range/Unsigned|-30|-10}} ((-30)-(-10)) Both boundaries are negative.