Skip to content
This repository was archived by the owner on Mar 23, 2025. It is now read-only.

Commit f22c9e8

Browse files
committed
Simplify the calculation of digits of the total number of pages
1 parent bfd4982 commit f22c9e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/mangadex/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ function nextPage() {
170170
const filename = atHome.chapter.data[page];
171171
if (!filename) return JSON.stringify({});
172172

173-
//Get the number of 'numbers' of pages
174-
const len = Math.ceil(Math.log(atHome.chapter.data.length + 1) / Math.LN10);
173+
//Get the number of digits of pages
174+
const len = atHome.chapter.data.length.toString().length;
175175
//Pad the page number with zeroes depending of the number of pages
176176
const pageNum = Array(Math.max(len - String(page + 1).length + 1, 0)).join(0) + (page + 1);
177177

0 commit comments

Comments
 (0)