Difference between revisions of "ConvertRating/Single"

From Sega Retro

Line 102: Line 102:
 
|0-10+={{#switch:{{#var:value}}
 
|0-10+={{#switch:{{#var:value}}
 
|0={{#vardefine:displayRating|0}}{{#vardefine:score|0}}
 
|0={{#vardefine:displayRating|0}}{{#vardefine:score|0}}
|0+={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:10/3}}}}
+
|0+={{#vardefine:displayRating|0+}}{{#vardefine:score|{{#expr:10/3}}}}
|1-={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:2*(10/3)}}}}
+
|1-={{#vardefine:displayRating|1-}}{{#vardefine:score|{{#expr:2*(10/3)}}}}
|1={{#vardefine:displayRating|0}}{{#vardefine:score|10}}
+
|1={{#vardefine:displayRating|1}}{{#vardefine:score|10}}
|1+={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:10+(10/3)}}}}
+
|1+={{#vardefine:displayRating|1+}}{{#vardefine:score|{{#expr:10+(10/3)}}}}
|2-={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:10+(2*(10/3))}}}}
+
|2-={{#vardefine:displayRating|2-}}{{#vardefine:score|{{#expr:10+(2*(10/3))}}}}
|2={{#vardefine:displayRating|0}}{{#vardefine:score|20}}
+
|2={{#vardefine:displayRating|2}}{{#vardefine:score|20}}
|2+={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:20+(10/3)}}}}
+
|2+={{#vardefine:displayRating|2+}}{{#vardefine:score|{{#expr:20+(10/3)}}}}
|3-={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:20+(2*(10/3))}}}}
+
|3-={{#vardefine:displayRating|3-}}{{#vardefine:score|{{#expr:20+(2*(10/3))}}}}
|3={{#vardefine:displayRating|0}}{{#vardefine:score|30}}
+
|3={{#vardefine:displayRating|3}}{{#vardefine:score|30}}
|3+={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:30+(10/3)}}}}
+
|3+={{#vardefine:displayRating|3+}}{{#vardefine:score|{{#expr:30+(10/3)}}}}
|4-={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:30+(2*(10/3))}}}}
+
|4-={{#vardefine:displayRating|4-}}{{#vardefine:score|{{#expr:30+(2*(10/3))}}}}
|4={{#vardefine:displayRating|0}}{{#vardefine:score|40}}
+
|4={{#vardefine:displayRating|4}}{{#vardefine:score|40}}
|4+={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:40+(10/3)}}}}
+
|4+={{#vardefine:displayRating|4+}}{{#vardefine:score|{{#expr:40+(10/3)}}}}
|5-={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:40+(2*(10/3))}}}}
+
|5-={{#vardefine:displayRating|5-}}{{#vardefine:score|{{#expr:40+(2*(10/3))}}}}
|5={{#vardefine:displayRating|0}}{{#vardefine:score|50}}
+
|5={{#vardefine:displayRating|5}}{{#vardefine:score|50}}
|5+={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:50+(10/3)}}}}
+
|5+={{#vardefine:displayRating|5+}}{{#vardefine:score|{{#expr:50+(10/3)}}}}
|6-={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:50+(2*(10/3))}}}}
+
|6-={{#vardefine:displayRating|6-}}{{#vardefine:score|{{#expr:50+(2*(10/3))}}}}
|6={{#vardefine:displayRating|0}}{{#vardefine:score|60}}
+
|6={{#vardefine:displayRating|6}}{{#vardefine:score|60}}
|6+={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:60+(10/3)}}}}
+
|6+={{#vardefine:displayRating|6+}}{{#vardefine:score|{{#expr:60+(10/3)}}}}
|7-={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:60+(2*(10/3))}}}}
+
|7-={{#vardefine:displayRating|7-}}{{#vardefine:score|{{#expr:60+(2*(10/3))}}}}
|7={{#vardefine:displayRating|0}}{{#vardefine:score|70}}
+
|7={{#vardefine:displayRating|7}}{{#vardefine:score|70}}
|7+={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:70+(10/3)}}}}
+
|7+={{#vardefine:displayRating|7+}}{{#vardefine:score|{{#expr:70+(10/3)}}}}
|8-={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:70+(2*(10/3))}}}}
+
|8-={{#vardefine:displayRating|8-}}{{#vardefine:score|{{#expr:70+(2*(10/3))}}}}
|8={{#vardefine:displayRating|0}}{{#vardefine:score|80}}
+
|8={{#vardefine:displayRating|8}}{{#vardefine:score|80}}
|8+={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:80+(10/3)}}}}
+
|8+={{#vardefine:displayRating|8+}}{{#vardefine:score|{{#expr:80+(10/3)}}}}
|9-={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:80+(2*(10/3))}}}}
+
|9-={{#vardefine:displayRating|9-}}{{#vardefine:score|{{#expr:80+(2*(10/3))}}}}
|9={{#vardefine:displayRating|0}}{{#vardefine:score|90}}
+
|9={{#vardefine:displayRating|9}}{{#vardefine:score|90}}
|9+={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:90+(10/3)}}}}
+
|9+={{#vardefine:displayRating|9+}}{{#vardefine:score|{{#expr:90+(10/3)}}}}
|10-={{#vardefine:displayRating|0}}{{#vardefine:score|{{#expr:90+(2*(10/3))}}}}
+
|10-={{#vardefine:displayRating|10-}}{{#vardefine:score|{{#expr:90+(2*(10/3))}}}}
|10={{#vardefine:displayRating|0}}{{#vardefine:score|100}}
+
|10={{#vardefine:displayRating|10}}{{#vardefine:score|100}}
 
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 
}}
 
}}

Revision as of 08:13, 10 May 2021

Rating conversion code for when there's only one value - stops Mediawiki from complaining about recursion.