Difference between revisions of "Template:Fluctuation formatter/doc"

From blackwiki
Jump to navigation Jump to search
imported>Mattbuck
m (→‎Examples: for clarity)
imported>Sdkb
(It's more the subject that seeks an increased/decreased value than the user; ce)
 
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
 
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
 
== Usage ==
 
== Usage ==
Takes a value and displays an {{tl|increase}}, {{tl|decrease}}, or {{tl|steady}} symbol with the value based on whether it is positive, negative, or zero. The type of value can be specified using the second parameter as "maximize", "minimize", or "neutral". Can be called using the shortcut '''{{tl|Fluc}}'''.
+
Takes a value and displays an {{tl|increase}}, {{tl|decrease}}, or {{tl|steady}} symbol with the value based (by default) on whether it is positive, negative, or zero. The type of value can be specified using the second parameter as "maximize", "minimize", or "neutral". Can be called using the shortcut '''{{tl|Fluc}}'''. It's meant to be used to show a fluctuation snapshot, where the provided value indicates a move up (positive) or down (negative), or possibly held steady (zero = no change) in relationship to some earlier measurement.
 +
 
 +
For example, a positive <code>Value</code> with a <code>Type</code> of "maximize" (the default) will show the green upward arrow of {{tl|increase}}, as that type assumes the goal is for the value to be maximized. Likewise, a negative <code>Value</code> with a <code>Type</code> of "maximize" produces the red downward arrow of {{tl|decrease}}.
 +
 
 +
Inversely, a positive <code>Value</code> with a <code>Type</code> of "minimize" will show the red downward arrow of {{tl|decrease}}, as that type assumes the goal is for the value to be minimized, but as a positive number, it's gone the wrong direction. Likewise, a negative <code>Value</code> with a <code>Type</code> of "minimize" produces the green upward arrow of {{tl|increase}}, since a minimized value is sought and the value has moved in that direction.
  
 
==Examples==
 
==Examples==
 
* {{tlx|fluc|47}} or {{tlx|fluc|47|maximize}} produces {{fluc|47}}
 
* {{tlx|fluc|47}} or {{tlx|fluc|47|maximize}} produces {{fluc|47}}
 
* {{tlx|fluc|-47}} or {{tlx|fluc|-47|maximize}} produces {{fluc|-47}}
 
* {{tlx|fluc|-47}} or {{tlx|fluc|-47|maximize}} produces {{fluc|-47}}
 +
* {{tlx|fluc|47|minimize}} produces {{fluc|47|minimize}}
 +
* {{tlx|fluc|-47|minimize}} produces {{fluc|-47|minimize}}
 
* {{tlx|fluc|0}} produces {{fluc|0}}
 
* {{tlx|fluc|0}} produces {{fluc|0}}
 
* {{tlx|fluc|-47|threshold{{=}}100}} produces {{fluc|-47|threshold=100}}
 
* {{tlx|fluc|-47|threshold{{=}}100}} produces {{fluc|-47|threshold=100}}
 
* {{tlx|fluc|0|steady label{{=}}unchanged}} produces {{fluc|0|steady label=unchanged}}
 
* {{tlx|fluc|0|steady label{{=}}unchanged}} produces {{fluc|0|steady label=unchanged}}
* {{tlx|fluc|47|minimize}} produces {{fluc|47|minimize}}
 
* {{tlx|fluc|-47|minimize}} produces {{fluc|-47|minimize}}
 
 
* {{tlx|fluc|47|neutral}} produces {{fluc|47|neutral}}
 
* {{tlx|fluc|47|neutral}} produces {{fluc|47|neutral}}
 
* {{tlx|fluc|-1000|custom label{{=}}$47 million}} produces {{fluc|-1000|custom label=$47 million}}
 
* {{tlx|fluc|-1000|custom label{{=}}$47 million}} produces {{fluc|-1000|custom label=$47 million}}
Line 35: Line 39:
 
"2": {
 
"2": {
 
"label": "Type",
 
"label": "Type",
"description": "The type of value being fed to the template. Use \"maximize\", \"minimize\", or \"neutral\".",
+
"description": "The type of value being fed to the template, which affects the arrow color. Use \"maximize\", \"minimize\", or \"neutral\".",
 
"default": "Maximize",
 
"default": "Maximize",
 
"aliases": [
 
"aliases": [

Latest revision as of 02:13, 20 September 2020

Usage

Takes a value and displays an {{increase}}, {{decrease}}, or {{steady}} symbol with the value based (by default) on whether it is positive, negative, or zero. The type of value can be specified using the second parameter as "maximize", "minimize", or "neutral". Can be called using the shortcut {{Fluc}}. It's meant to be used to show a fluctuation snapshot, where the provided value indicates a move up (positive) or down (negative), or possibly held steady (zero = no change) in relationship to some earlier measurement.

For example, a positive Value with a Type of "maximize" (the default) will show the green upward arrow of {{increase}}, as that type assumes the goal is for the value to be maximized. Likewise, a negative Value with a Type of "maximize" produces the red downward arrow of {{decrease}}.

Inversely, a positive Value with a Type of "minimize" will show the red downward arrow of {{decrease}}, as that type assumes the goal is for the value to be minimized, but as a positive number, it's gone the wrong direction. Likewise, a negative Value with a Type of "minimize" produces the green upward arrow of {{increase}}, since a minimized value is sought and the value has moved in that direction.

Examples

TemplateData

Takes a value and displays an increase, decrease, or steady symbol based on whether the value is positive, negative, or zero.

Template parameters

ParameterDescriptionTypeStatus
Value1

The value being fed to the template

Example
-47
Numberrequired
Type2 type

The type of value being fed to the template, which affects the arrow color. Use "maximize", "minimize", or "neutral".

Default
Maximize
Unknownoptional
Steady labelsteady label

Specifies custom text to use alongside a steady result

Default
no change
Example
unchanged
Stringoptional
Custom labelcustom label

Specifies a custom value to display instead of the one being fed into the template

Stringoptional
Thresholdthreshold

Specifies the maximum deviation from zero for which a steady symbol will display

Default
0
Numberoptional

See also