mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-28 17:07:55 +01:00
Fixed roundDown bug
This commit is contained in:
1 parent
bb8def7959
commit
f51258c660
3 files changed
+7
-4
No files matched your search
@@ -139,7 +139,8 @@
|
||||
|
||||
function roundDown(num) {
|
||||
if (num < 1000) return num;
|
||||
const decimal = Math.floor(Math.log10(num) - 1);
|
||||
const int = Math.floor(Math.log10(num) - 2);
|
||||
const decimal = int + (int % 3 ? 1 : 0);
|
||||
const value = Math.floor(num / 10 ** decimal);
|
||||
return value * (10 ** decimal);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user