Star Ratings from a Numeric Range
Assuming $rating
is a numeric field with a minimum of 1 and a maximum of 5, generate a star rating out of a maximum of 5 stars.
This will take a numeric field value in $rating
and convert it into actual star characters.
SETRESULT(Array(FLOOR($rating + 1)).join('★') + Array(FLOOR(6 - $rating)).join('☆'));
Entering "3" gives the output: "★★★☆☆".
Updated about 1 year ago