You need to sign in to do that
Don't have an account?
krishna casukhela
Star Rating in lightning aura component
I have a API response as follows.
"practitionerReviewSummary": {
"avg_overall_rating": 4.15,
"total_reviews": 4
}
Inside lightning component I will show 5 stars (something similar to amazon when we buy a product, we have ratings show in stars)
If its 4 stars then 4 stars will be bold.
But if rating = 4.15 then pls let me know how to do this through code.
Thanks
Krishna
"practitionerReviewSummary": {
"avg_overall_rating": 4.15,
"total_reviews": 4
}
Inside lightning component I will show 5 stars (something similar to amazon when we buy a product, we have ratings show in stars)
If its 4 stars then 4 stars will be bold.
But if rating = 4.15 then pls let me know how to do this through code.
Thanks
Krishna
Do Math.round on your rating => If rating >= 4.5 then it'll display 5 and it is 4 <= 4 <4.5 it'll display 4
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.