Update Reddit-Widget.js

This commit is contained in:
Robinson
2022-05-02 19:51:07 +02:00
committed by GitHub
parent 097ae23392
commit 7f48e4fc3c
+5 -1
View File
@@ -86,7 +86,7 @@ if (minutesDiff() < 525600) { //525600min = one year
since = Math.abs(minutesDiff()/60/24).toFixed(0)
time = " d"
} else {
since = Math.abs(minutesDiff()/60/24/7/4/12).toFixed(1)
since = Math.abs(minutesDiff()/60/24/365).toFixed(1)
time = " y"
}
@@ -102,6 +102,10 @@ arr.forEach((item, index) => {
}
});
arr.forEach((item, index) => {
arr[index] = Intl.NumberFormat('locale', {notation:'compact', maximumSignificantDigits: 4}).format(item)
})
// DECLARE VARIABLES
var totalKarma = arr[0];
var postKarma = arr[1];