fix conversion to imdb rating in JS
This commit is contained in:
parent
bae0415a24
commit
e56ff8a6e6
1 changed files with 2 additions and 2 deletions
|
|
@ -56,7 +56,7 @@ function imdb_stdev(scores) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function imdb_rating_from_score(score) {
|
function imdb_rating_from_score(score) {
|
||||||
return Math.round((score * 9) / 100 + 1)
|
return Math.round((score * 9) / 10 + 10) / 10
|
||||||
}
|
}
|
||||||
|
|
||||||
function imdb_rating(score) {
|
function imdb_rating(score) {
|
||||||
|
|
@ -64,7 +64,7 @@ function imdb_rating(score) {
|
||||||
return "-"
|
return "-"
|
||||||
}
|
}
|
||||||
|
|
||||||
const deci = Math.round((score * 9) / 10 + 10)
|
const deci = 10 * imdb_rating_from_score(score)
|
||||||
return `${(deci / 10) | 0}.${deci % 10}`
|
return `${(deci / 10) | 0}.${deci % 10}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue