mirror of
https://github.com/peritus/obsidian-interactive-ratings.git
synced 2026-07-22 05:43:17 +00:00
fix supportsHalf type: boolean
This commit is contained in:
parent
caed29208a
commit
bf9bd56c78
1 changed files with 2 additions and 2 deletions
4
main.ts
4
main.ts
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue