From ae2264c7063ebc248e73232e533f3ce49dc4af18 Mon Sep 17 00:00:00 2001 From: BroodjeAap Date: Mon, 16 Nov 2020 20:09:36 +0100 Subject: [PATCH] added rounding to 1 decimal place to sqlite answer stats queries --- lib/pages/practice/PracticeDatabase.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pages/practice/PracticeDatabase.dart b/lib/pages/practice/PracticeDatabase.dart index fe9a640..74c0394 100644 --- a/lib/pages/practice/PracticeDatabase.dart +++ b/lib/pages/practice/PracticeDatabase.dart @@ -134,7 +134,7 @@ class PracticeDatabase { correct, incorrect, total, - (correct / total) * 100 AS ratio + ROUND((correct / total) * 100, 1) AS ratio FROM AnswersCorrectByTypeViewAll UNION ALL @@ -144,7 +144,7 @@ class PracticeDatabase { correct, incorrect, total, - (correct / total) * 100 AS ratio + ROUND((correct / total) * 100, 1) AS ratio FROM AnswersCorrectByTypeView7d UNION ALL @@ -154,7 +154,7 @@ class PracticeDatabase { correct, incorrect, total, - (correct / total) * 100 AS ratio + ROUND((correct / total) * 100, 1) AS ratio FROM AnswersCorrectByTypeView30d; '''); @@ -173,7 +173,7 @@ class PracticeDatabase { ["All", "30d", "7d"].forEach((range) => { PracticeType.values.forEach((type) { var typeRange = "$range ${type.toString().split(".").last}"; - emptyStats[typeRange] = 0; + emptyStats[typeRange] = 0.0; }) }); return emptyStats;