Skip to content

Commit 3e56d4d

Browse files
author
Suhas Hariharan
committed
fixed edge case for percentage parsing
Signed-off-by: Suhas Hariharan <[email protected]>
1 parent 175a1b4 commit 3e56d4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function extractFinalPercent (html) {
150150
let current_string = html.match(/(?=document\.write).*/g)[1];
151151
current_string = /\[.*\]/g.exec(current_string)[0].slice(1, -1);
152152
const temp = current_string.split(";");
153-
number = Math.max(isNaN(temp[temp.length - 2]) ? -Infinity : parseFloat(temp[temp.length - 2]), isNaN(temp[temp.length - 1]) ? -Infinity : parseFloat(temp[temp.length - 1]));
153+
number = Math.max(isNaN(parseFloat(temp[temp.length - 2])) ? -Infinity : parseFloat(temp[temp.length - 2]), isNaN(parseFloat(temp[temp.length - 1])) ? -Infinity : parseFloat(temp[temp.length - 1]));
154154
} catch (e) {
155155
return;
156156
}

0 commit comments

Comments
 (0)