mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-21 21:55:38 +00:00
Fixed an issue where fractional rating values were always rounded up.
This commit is contained in:
parent
96503a23c6
commit
a62be38c85
|
@ -36,8 +36,8 @@ void RatingComponent::setValue(const std::string& value)
|
|||
mValue = 0.0f;
|
||||
}
|
||||
else {
|
||||
// Round up to the closest .1 value, i.e. to the closest half-icon.
|
||||
mValue = ceilf(stof(value) / 0.1f) / 10.0f;
|
||||
// Round to the closest .1 value, i.e. to the closest half-icon.
|
||||
mValue = std::round(stof(value) / 0.1f) / 10.0f;
|
||||
mOriginalValue = static_cast<int>(mValue * 10.0f);
|
||||
|
||||
// If the argument to colorize the rating icons has been passed, set the
|
||||
|
|
Loading…
Reference in a new issue