fix supportsHalf type: boolean

This commit is contained in:
Filip Noetzel 2025-03-21 08:27:35 +01:00
parent caed29208a
commit bf9bd56c78

View file

@ -48,13 +48,13 @@ function generateSymbolsString(rating, symbolCount, full, empty, half, supportsH
}
// Extract the function to format rating text
function formatRatingText(format, newRating, symbolCount, denominator, supportsHalf) {
function formatRatingText(format, newRating, symbolCount, denominator, supportsHalf: boolean) {
let newNumerator;
if (format.includes('percent')) {
newNumerator = Math.round((newRating / symbolCount) * 100);
} else {
newNumerator = newRating;
if (supportsHalf !== 'true') {
if (!supportsHalf) {
newNumerator = Math.round(newNumerator);
}
}