From e56ff8a6e6eaad38f1e2b0ba6d95b33c79267145 Mon Sep 17 00:00:00 2001 From: ducklet Date: Wed, 4 Aug 2021 17:10:44 +0200 Subject: [PATCH] fix conversion to imdb rating in JS --- unwind-ui/src/components/MovieList.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unwind-ui/src/components/MovieList.vue b/unwind-ui/src/components/MovieList.vue index 9903594..35f371d 100644 --- a/unwind-ui/src/components/MovieList.vue +++ b/unwind-ui/src/components/MovieList.vue @@ -56,7 +56,7 @@ function imdb_stdev(scores) { } 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) { @@ -64,7 +64,7 @@ function imdb_rating(score) { return "-" } - const deci = Math.round((score * 9) / 10 + 10) + const deci = 10 * imdb_rating_from_score(score) return `${(deci / 10) | 0}.${deci % 10}` }