Difference between revisions of "ConvertRating"
From Sega Retro
Line 13: | Line 13: | ||
}} | }} | ||
− | |0-10s={{# | + | |0-10s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|10}}}}{{#vardefine:score|{{#expr:{{#var:value}}*10}}}} |
− | | | ||
− | }} | ||
|1-10s={{#switch:{{#var:value}} | |1-10s={{#switch:{{#var:value}} | ||
Line 21: | Line 19: | ||
}} | }} | ||
− | |0-4={{# | + | |0-4={{#vardefine:displayRating|{{#var:value}}/4}}{{#vardefine:score|{{#expr:{{#var:value}}*25}}}} |
− | |||
− | }} | ||
|1-4={{#switch:{{#var:value}} | |1-4={{#switch:{{#var:value}} | ||
Line 29: | Line 25: | ||
}} | }} | ||
− | |0-5={{# | + | |0-5={{#vardefine:displayRating|{{#var:value}}/5}}{{#vardefine:score|{{#expr:{{#var:value}}*20}}}} |
− | |||
− | }} | ||
|1-5={{#switch:{{#var:value}} | |1-5={{#switch:{{#var:value}} | ||
Line 37: | Line 31: | ||
}} | }} | ||
− | |0- | + | |0-10={{#vardefine:displayRating|{{#var:value}}/10}}{{#vardefine:score|{{#expr:{{#var:value}}*10}}}} |
− | |||
− | }} | ||
|1-10={{#switch:{{#var:value}} | |1-10={{#switch:{{#var:value}} | ||
Line 45: | Line 37: | ||
}} | }} | ||
− | |0-20={{# | + | |0-20={{#vardefine:displayRating|{{#var:value}}/20}}{{#vardefine:score|{{#expr:{{#var:value}}*5}}}} |
− | |||
− | }} | ||
|1-20={{#switch:{{#var:value}} | |1-20={{#switch:{{#var:value}} | ||
Line 53: | Line 43: | ||
}} | }} | ||
− | |0-100={{# | + | |0-100={{#vardefine:displayRating|{{#var:value}}%}}{{#vardefine:score|{{#var:value}}}} |
− | |||
− | }} | ||
− | |0-1000={{# | + | |0-1000={{#vardefine:displayRating|{{#var:value}}}}{{#vardefine:score|{{#expr:{{#var:value}}/10}}}} |
− | |||
− | }} | ||
|A-F={{#switch:{{#var:value}} | |A-F={{#switch:{{#var:value}} | ||
Line 86: | Line 72: | ||
===0-4s=== | ===0-4s=== | ||
{| class="prettytable" style="width:auto;" | {| class="prettytable" style="width:auto;" | ||
+ | !Input | ||
+ | !Display | ||
+ | !Score | ||
|- | |- | ||
{{ConvertRating|0-4s|0}} | {{ConvertRating|0-4s|0}} |
Revision as of 04:09, 20 April 2020
This task is unfinished This is a wiki task that requires more thought or peer review. An important issue that needs to be solved, which will appear at the top of Sega Retro:Todo until this message is removed. |
A template for converting a rating, as printed in a magazine into:
- something nice to display ({{#var:displayRating}})
- a value out of 100 for use in Sega Retro averages ({{#var:score}})
multiple instances of the above (e.g. support "1,2,3,4" for EGM)
added text. e.g. later issues of the UK Official Dreamcast magazine, 7 = "good".
it should be able to detect if a given value is invalid. Some magazines could be using multiple systems depending on context.
The user should not be expected to calculate anything.
Working values
0-4s
Input | Display | Score |
---|---|---|
0 | 0 | |
1 | 25 | |
2 | 50 | |
3 | 75 | |
4 | 100 |