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.
This commit is contained in:
Nick Savage
2017-01-17 22:49:12 -05:00
committed by Qingping Hou
parent 97d34c5bb0
commit d33fee3a40

View File

@@ -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