Difference between revisions of "ConvertRating/Single"

From Sega Retro

(Created page with "<includeonly>{{#switch:{{#var:system}} |0-4s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|4}}}}{{#vardefine:score|{{#expr:{{#var:value}}*25}}}} |1-4s={{#vardefine:d...")
 
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#switch:{{#var:system}}
+
<includeonly>{{#vardefine:system|{{{1|}}}}}{{#vardefine:value|{{{2|}}}}}{{#switch:{{#var:system}}
 
|0-4s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|4}}}}{{#vardefine:score|{{#expr:{{#var:value}}*25}}}}
 
|0-4s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|4}}}}{{#vardefine:score|{{#expr:{{#var:value}}*25}}}}
  
Line 7: Line 7:
  
 
|1-5s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|5}}}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*25}}}}
 
|1-5s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|5}}}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*25}}}}
 +
 +
|0-6s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|6}}}}{{#vardefine:score|{{#expr:{{#var:value}}*(100/6)}}}}
 +
 +
|1-6s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|6}}}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*20}}}}
  
 
|0-10s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|10}}}}{{#vardefine:score|{{#expr:{{#var:value}}*10}}}}
 
|0-10s={{#vardefine:displayRating|{{StarRating|{{#var:value}}|10}}}}{{#vardefine:score|{{#expr:{{#var:value}}*10}}}}
Line 19: Line 23:
  
 
|1-5={{#vardefine:displayRating|{{#var:value}}/5}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*25}}}}
 
|1-5={{#vardefine:displayRating|{{#var:value}}/5}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*25}}}}
 +
 +
|0-6={{#vardefine:displayRating|{{#var:value}}/6}}{{#vardefine:score|{{#expr:{{#var:value}}*(100/6)}}}}
 +
 +
|1-6={{#vardefine:displayRating|{{#var:value}}/6}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*20}}}}
 +
 +
|-1-6={{#vardefine:displayRating|{{#var:value}}}}{{#vardefine:score|{{#expr:100-(({{#var:value}}-1)*20)}}}}
 +
 +
|0-7={{#vardefine:displayRating|{{#var:value}}/7}}{{#vardefine:score|{{#expr:{{#var:value}}*(100/7)}}}}
  
 
|0-10={{#vardefine:displayRating|{{#var:value}}/10}}{{#vardefine:score|{{#expr:{{#var:value}}*10}}}}
 
|0-10={{#vardefine:displayRating|{{#var:value}}/10}}{{#vardefine:score|{{#expr:{{#var:value}}*10}}}}
 +
 +
|0-12={{#vardefine:displayRating|{{#var:value}}/12}}{{#vardefine:score|{{#expr:{{#var:value}}*(100/12)}}}}
  
 
|1-10={{#vardefine:displayRating|{{#var:value}}/10}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*(100/9)}}}}
 
|1-10={{#vardefine:displayRating|{{#var:value}}/10}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*(100/9)}}}}
Line 27: Line 41:
  
 
|1-20={{#vardefine:displayRating|{{#var:value}}/20}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*(100/19)}}}}
 
|1-20={{#vardefine:displayRating|{{#var:value}}/20}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*(100/19)}}}}
 +
 +
|0-40={{#vardefine:displayRating|{{#var:value}}/40}}{{#vardefine:score|{{#expr:{{#var:value}}*(100/40)}}}}
 +
 +
|0-50={{#vardefine:displayRating|{{#var:value}}/50}}{{#vardefine:score|{{#expr:{{#var:value}}*2}}}}
  
 
|0-100={{#vardefine:displayRating|{{#var:value}}%}}{{#vardefine:score|{{#var:value}}}}
 
|0-100={{#vardefine:displayRating|{{#var:value}}%}}{{#vardefine:score|{{#var:value}}}}
Line 65: Line 83:
 
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 
}}
 
}}
 
|gamepro={{ConvertRating/GamePro|{{#var:value}}}}
 
  
 
|german={{#switch:{{#var:value}}
 
|german={{#switch:{{#var:value}}
Line 85: Line 101:
 
|5-={{#vardefine:displayRating|5-}}{{#vardefine:score|{{#expr:(1/15) * 100}}}}
 
|5-={{#vardefine:displayRating|5-}}{{#vardefine:score|{{#expr:(1/15) * 100}}}}
 
|6={{#vardefine:displayRating|6}}{{#vardefine:score|0}}
 
|6={{#vardefine:displayRating|6}}{{#vardefine:score|0}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 +
|0-10+={{#switch:{{#var:value}}
 +
|0={{#vardefine:displayRating|0}}{{#vardefine:score|0}}
 +
|0+={{#vardefine:displayRating|0+}}{{#vardefine:score|{{#expr:10/3}}}}
 +
|1-={{#vardefine:displayRating|1-}}{{#vardefine:score|{{#expr:2*(10/3)}}}}
 +
|1={{#vardefine:displayRating|1}}{{#vardefine:score|10}}
 +
|1+={{#vardefine:displayRating|1+}}{{#vardefine:score|{{#expr:10+(10/3)}}}}
 +
|2-={{#vardefine:displayRating|2-}}{{#vardefine:score|{{#expr:10+(2*(10/3))}}}}
 +
|2={{#vardefine:displayRating|2}}{{#vardefine:score|20}}
 +
|2+={{#vardefine:displayRating|2+}}{{#vardefine:score|{{#expr:20+(10/3)}}}}
 +
|3-={{#vardefine:displayRating|3-}}{{#vardefine:score|{{#expr:20+(2*(10/3))}}}}
 +
|3={{#vardefine:displayRating|3}}{{#vardefine:score|30}}
 +
|3+={{#vardefine:displayRating|3+}}{{#vardefine:score|{{#expr:30+(10/3)}}}}
 +
|4-={{#vardefine:displayRating|4-}}{{#vardefine:score|{{#expr:30+(2*(10/3))}}}}
 +
|4={{#vardefine:displayRating|4}}{{#vardefine:score|40}}
 +
|4+={{#vardefine:displayRating|4+}}{{#vardefine:score|{{#expr:40+(10/3)}}}}
 +
|5-={{#vardefine:displayRating|5-}}{{#vardefine:score|{{#expr:40+(2*(10/3))}}}}
 +
|5={{#vardefine:displayRating|5}}{{#vardefine:score|50}}
 +
|5+={{#vardefine:displayRating|5+}}{{#vardefine:score|{{#expr:50+(10/3)}}}}
 +
|6-={{#vardefine:displayRating|6-}}{{#vardefine:score|{{#expr:50+(2*(10/3))}}}}
 +
|6={{#vardefine:displayRating|6}}{{#vardefine:score|60}}
 +
|6+={{#vardefine:displayRating|6+}}{{#vardefine:score|{{#expr:60+(10/3)}}}}
 +
|7-={{#vardefine:displayRating|7-}}{{#vardefine:score|{{#expr:60+(2*(10/3))}}}}
 +
|7={{#vardefine:displayRating|7}}{{#vardefine:score|70}}
 +
|7+={{#vardefine:displayRating|7+}}{{#vardefine:score|{{#expr:70+(10/3)}}}}
 +
|8-={{#vardefine:displayRating|8-}}{{#vardefine:score|{{#expr:70+(2*(10/3))}}}}
 +
|8={{#vardefine:displayRating|8}}{{#vardefine:score|80}}
 +
|8+={{#vardefine:displayRating|8+}}{{#vardefine:score|{{#expr:80+(10/3)}}}}
 +
|9-={{#vardefine:displayRating|9-}}{{#vardefine:score|{{#expr:80+(2*(10/3))}}}}
 +
|9={{#vardefine:displayRating|9}}{{#vardefine:score|90}}
 +
|9+={{#vardefine:displayRating|9+}}{{#vardefine:score|{{#expr:90+(10/3)}}}}
 +
|10-={{#vardefine:displayRating|10-}}{{#vardefine:score|{{#expr:90+(2*(10/3))}}}}
 +
|10={{#vardefine:displayRating|10}}{{#vardefine:score|100}}
 +
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 +
}}
 +
 +
|1-6+={{#switch:{{#var:value}}
 +
|6+={{#vardefine:displayRating|6+}}{{#vardefine:score|100}}
 +
|6={{#vardefine:displayRating|6}}{{#vardefine:score|{{#expr:(14/15) * 100}}}}
 +
|6--={{#vardefine:displayRating|6-}}{{#vardefine:score|{{#expr:(13/15) * 100}}}}
 +
|5+={{#vardefine:displayRating|5+}}{{#vardefine:score|80}}
 +
|5={{#vardefine:displayRating|5}}{{#vardefine:score|{{#expr:(11/15) * 100}}}}
 +
|5-={{#vardefine:displayRating|5-}}{{#vardefine:score|{{#expr:(10/15) * 100}}}}
 +
|4+={{#vardefine:displayRating|4+}}{{#vardefine:score|60}}
 +
|4={{#vardefine:displayRating|4}}{{#vardefine:score|{{#expr:(8/15) * 100}}}}
 +
|4-={{#vardefine:displayRating|4-}}{{#vardefine:score|{{#expr:(7/15) * 100}}}}
 +
|3+={{#vardefine:displayRating|3+}}{{#vardefine:score|40}}
 +
|3={{#vardefine:displayRating|3}}{{#vardefine:score|{{#expr:(5/15) * 100}}}}
 +
|3-={{#vardefine:displayRating|3-}}{{#vardefine:score|{{#expr:(4/15) * 100}}}}
 +
|2+={{#vardefine:displayRating|2+}}{{#vardefine:score|20}}
 +
|2={{#vardefine:displayRating|2}}{{#vardefine:score|{{#expr:(2/15) * 100}}}}
 +
|2-={{#vardefine:displayRating|2-}}{{#vardefine:score|{{#expr:(1/15) * 100}}}}
 +
|1={{#vardefine:displayRating|1}}{{#vardefine:score|0}}
 
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 
|#default={{#vardefine:displayRating|Unknown value!}}{{#vardefine:score|}}
 
}}
 
}}
Line 90: Line 161:
 
|#default={{#vardefine:displayRating|Unknown system! ("{{#var:system}}")}}{{#vardefine:score|}}
 
|#default={{#vardefine:displayRating|Unknown system! ("{{#var:system}}")}}{{#vardefine:score|}}
 
}}</includeonly><noinclude>Rating conversion code for when there's only one value - stops Mediawiki from complaining about recursion.
 
}}</includeonly><noinclude>Rating conversion code for when there's only one value - stops Mediawiki from complaining about recursion.
[[Category:Sega Retro templates]]</noinclude>
+
[[Category:Templates]]</noinclude>

Latest revision as of 13:13, 1 January 2022

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