Can we use decimal numbers for ratings on UGC (example: 4.5), rather than integer numbers?
Thanks in advance!
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It only takes a minute to sign up.
Sign up to join this communityLooking at the API documentation, you can get the item ratings using the following API call:
ItemStatsRetriever.RetrieveItemStats(PageUri)
This will return an ItemStats
object.
The AverageRating
property of this is a double. I haven't tested this, but I'd assume, therefore, that this supports decimal values.
public double AverageRating { get; set; }
With regards to posting ratings (i.e. a user giving an item a mark out of five), then this can only be an integer:
WebServiceHelper.PostRating Method:
public static void PostRating(
string itemUri,
int ratingValue
)
You can find further details about ratings in Pankaj's blog post here: https://pankajgaur83.wordpress.com/2015/12/08/tridion-user-generated-content-blog-series-part-iv/