From d33fee3a402560f6debe3c9d6aed48a9ed27d228 Mon Sep 17 00:00:00 2001 From: Nick Savage Date: Tue, 17 Jan 2017 22:49:12 -0500 Subject: [PATCH] Statistics: Add percentage completed to Statistics plugin Makes percentage completed easily accessible through the statistics plugin. It has always been accessible through the status bar, but not through the statistics menu. --- plugins/statistics.koplugin/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/statistics.koplugin/main.lua b/plugins/statistics.koplugin/main.lua index c8db8f1de..e39ad8705 100755 --- a/plugins/statistics.koplugin/main.lua +++ b/plugins/statistics.koplugin/main.lua @@ -310,6 +310,7 @@ function ReaderStatistics:getCurrentStat() { _("Total days"), total_days }, { _("Average time per page"), util.secondsToClock(avg_time_per_page, false) }, { _("Read pages/Total pages"), read_pages .. "/" .. self.data.pages }, + { _("Percentage completed"), math.floor(read_pages / self.data.pages * 100 + 0.5) .. "%" }, -- adding 0.5 rounds to nearest integer with math.floor } end