nashio / star-rating-svg

A star rating jQuery plugin that uses SVG for easier customization
http://nashio.github.io/star-rating-svg/demo
MIT License
355 stars 156 forks source link

Is it possible to use the greater value of star to be shown??? #29

Closed Nageshwar closed 6 years ago

Nageshwar commented 6 years ago

Hello Team,

I would like to show the Star values in this pattern

0.0 till <= 0.5: 0.5 filled star 0.5 till <= 1.0: 1.0 filled star 1.0 till <= 1.5: 1.5 filled stars 1.5 till <= 2.0: 2.0 filled stars 2.0 till <= 2.5: 2.5 filled stars 2.5 till <= 3.0: 3 filled stars 3.0 till <= 3.5: 3.5 filled stars 3.5 <= 4.0: 4 filled stars 4.0 till <= 4.5: 4.5 filled stars 4.5 till <= 5: 5 filled stars

Is it possible to do that in this manner???

please reply asap that would be very helpful

Thanks Nageshwar Jha

nashio commented 6 years ago

Hi @Nageshwar , not sure I follow. Isn't that what its happening right now? for ex. if I hover from 2.0 to 2.5 then 2.5 stars will be filled. please elaborate, thank you

Nageshwar commented 6 years ago

Hello @nashio ,

I would like to Show the intial rating of star when the value will be 4.7 then the star will be 5 prefilled as please check screenshot.

screenshot_22

but what actually happening is for 4.7 star the image is showing 4.5 stars not 5.

Did you understand now, what i mean?

nashio commented 6 years ago

I see, on initial load then. Yeah right now its rounding down, you need up. hm, I'm thinking maybe of adding an option to round both ways, could be useful.

Nageshwar commented 6 years ago

Yes but half rounding will be great (Y)

For example 4.1 should be 4.5 not 5.

Thanks @nashio

nashio commented 6 years ago

yeah thats what I meant actually, 4.1 -> 4.5, instead of 4.0

Nageshwar commented 6 years ago

Yes

That will be great (y)

Thanks in Advance

nashio commented 6 years ago

@Nageshwar
download the newest version and use the option, forceRoundUp: true. check the readme for reference: https://github.com/nashio/star-rating-svg/blob/master/README.md let me know if that works for you

Nageshwar commented 6 years ago

Great (y)

Thanks , I will surely let you know.

Nageshwar commented 6 years ago

Yes it worked perfectly for my testcases: rating 4.7 it shows 5, rating 4.001 it shows 4.5 rating 4.00 it shows 4.

Great work @nashio