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.
pull/2506/head
Nick Savage 7 years ago committed by Qingping Hou
parent 97d34c5bb0
commit d33fee3a40

@ -310,6 +310,7 @@ function ReaderStatistics:getCurrentStat()
{ _("Total days"), total_days }, { _("Total days"), total_days },
{ _("Average time per page"), util.secondsToClock(avg_time_per_page, false) }, { _("Average time per page"), util.secondsToClock(avg_time_per_page, false) },
{ _("Read pages/Total pages"), read_pages .. "/" .. self.data.pages }, { _("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 end

Loading…
Cancel
Save