Difference between revisions of "ConvertRating/Single"

From Sega Retro

Line 26: Line 26:
 
|1-6={{#vardefine:displayRating|{{#var:value}}/6}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*20}}}}
 
|1-6={{#vardefine:displayRating|{{#var:value}}/6}}{{#vardefine:score|{{#expr:({{#var:value}}-1)*20}}}}
  
|-1-6={{#vardefine:displayRating|{{#var:value}}/6}}{{#vardefine:score|{{#expr:100-(({{#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-7={{#vardefine:displayRating|{{#var:value}}/7}}{{#vardefine:score|{{#expr:{{#var:value}}*(100/7)}}}}

Revision as of 10:59, 14 May 2021

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