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

From Basin Wiki
< User:Trang Oul‎ | Sandbox‎ | Template:Range
Revision as of 20:30, 4 November 2026 by Trang Oul (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Usage

{{Range/Signed|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 and prefixes it with a leading + sign. Both boundaries retain their original parameter order.
  • Non-positive range (max ≤ 0): Displays the absolute values of both boundaries in reverse parameter order (max before min), enclosing the range in parentheses and prefixing it with a leading - sign.
  • Mixed-sign range (otherwise): Encloses the range and each boundary in parentheses, preserving the original parameter order and marking the positive maximum with a leading + sign.

Examples

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