Difference between revisions of "StarRating"

From Sega Retro

Line 2: Line 2:
 
| {{#expr:{{#var:i}} < {{#var:total}}}}{{incvar|i}}
 
| {{#expr:{{#var:i}} < {{#var:total}}}}{{incvar|i}}
 
| {{#ifexpr:{{#var:i}} <= {{#var:starrating}}|[[File:{{#var:full}}|{{#var:imagesize}}px|link=|]]|[[File:{{#var:empty}}|{{#var:imagesize}}px|link=|]]}}
 
| {{#ifexpr:{{#var:i}} <= {{#var:starrating}}|[[File:{{#var:full}}|{{#var:imagesize}}px|link=|]]|[[File:{{#var:empty}}|{{#var:imagesize}}px|link=|]]}}
}}</includeonly><noinclude>
+
}}{{#vardefine:starscore|{{#expr:({{#var:starrating}}/{{#var:total}})*100}}}}</includeonly><noinclude>
 
A template to display "star" ratings.
 
A template to display "star" ratings.
  

Revision as of 13:33, 6 December 2018

A template to display "star" ratings.

Usage

{{StarRating|3|5}}

Produces: RatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Empty.svgRatingStar Empty.svg

{{StarRating|33|50}}

Produces: RatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Full.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svgRatingStar Empty.svg