Template:Sandbox/Aurelain/HeroClassSkills/value: Difference between revisions
From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
-->{{#expr: (100 * {{{1 | -->{{#if: {{{1|}}}|<!-- | ||
-->{{#expr: (100 * {{{1}}} / {{{2}}}) round 2}}%<!-- | |||
-->}}<!-- | |||
--></includeonly><!-- | --></includeonly><!-- | ||
################################################################################ | ################################################################################ | ||
| Line 8: | Line 10: | ||
<!--=========================================================================--> | <!--=========================================================================--> | ||
==1. | ==1. Integer:== | ||
{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/HeroClassSkills/value|150|1000}}</nowiki></code> | {{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/HeroClassSkills/value|150|1000}}</nowiki></code> | ||
| Line 15: | Line 17: | ||
<!--=========================================================================--> | <!--=========================================================================--> | ||
==2. | ==2. Float 1:== | ||
{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/HeroClassSkills/value|123|1000}}</nowiki></code> | {{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/HeroClassSkills/value|123|1000}}</nowiki></code> | ||
| Line 22: | Line 24: | ||
<!--=========================================================================--> | <!--=========================================================================--> | ||
==3. | ==3. Float 2:== | ||
{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/HeroClassSkills/value|3|10}}</nowiki></code> | {{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/HeroClassSkills/value|3|10}}</nowiki></code> | ||
{{Color|lime|Output:}} {{Sandbox/Aurelain/HeroClassSkills/value| | {{Color|lime|Output:}} {{Sandbox/Aurelain/HeroClassSkills/value|3|10}} | ||
<!--=========================================================================--> | <!--=========================================================================--> | ||
Revision as of 08:26, 8 August 2026
Renders a number either as raw value or as percentage.
1. Integer:
Input: {{Sandbox/Aurelain/HeroClassSkills/value|150|1000}}
Output: x15%y
2. Float 1:
Input: {{Sandbox/Aurelain/HeroClassSkills/value|123|1000}}
Output: 12.3%
3. Float 2:
Input: {{Sandbox/Aurelain/HeroClassSkills/value|3|10}}
Output: 30%
4. Invalid numerator:
Input: {{Sandbox/Aurelain/HeroClassSkills/value||1000}}
Output:


