Skip to content

Commit

Permalink
fix(ratings): Whole number ratings displays as half ratings (#156)
Browse files Browse the repository at this point in the history
Co-authored-by: ManonPolle <[email protected]>
  • Loading branch information
apauchet and ManonPolle committed Jun 22, 2023
1 parent 709762c commit 6f71eb5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ internal sealed class Icon(val imageVector: ImageVector) {
private const val HALF = 0.5f
fun get(index: Int, number: Float): Icon {
val floor = floor(number).toInt()
return if (floor == index) {
val decimal = number - index
val decimal = number - index
return if (floor == index && decimal != 0f) {
if (decimal < HALF) Half else Fill
} else if (index < number) {
Fill
Expand Down

0 comments on commit 6f71eb5

Please sign in to comment.