diff --git a/package.json b/package.json
index 6eb9a615..7d7a2644 100644
--- a/package.json
+++ b/package.json
@@ -73,7 +73,6 @@
"unicorn/filename-case": "off",
"unicorn/no-fn-reference-in-iterator": "off",
"unicorn/no-for-loop": "off",
- "unicorn/no-zero-fractions": "off",
"unicorn/prefer-includes": "off",
"unicorn/prefer-node-append": "off",
"unicorn/prefer-number-properties": "off",
diff --git a/scripts/pi-hole/js/db_graph.js b/scripts/pi-hole/js/db_graph.js
index c27e58c2..da24216f 100644
--- a/scripts/pi-hole/js/db_graph.js
+++ b/scripts/pi-hole/js/db_graph.js
@@ -269,11 +269,11 @@ $(document).ready(function () {
},
label: function (tooltipItems, data) {
if (tooltipItems.datasetIndex === 0) {
- var percentage = 0.0;
+ var percentage = 0;
var permitted = parseInt(data.datasets[1].data[tooltipItems.index]);
var blocked = parseInt(data.datasets[0].data[tooltipItems.index]);
if (permitted + blocked > 0) {
- percentage = (100.0 * blocked) / (permitted + blocked);
+ percentage = (100 * blocked) / (permitted + blocked);
}
return (
diff --git a/scripts/pi-hole/js/db_lists.js b/scripts/pi-hole/js/db_lists.js
index dc641d39..6cd643fb 100644
--- a/scripts/pi-hole/js/db_lists.js
+++ b/scripts/pi-hole/js/db_lists.js
@@ -97,7 +97,7 @@ function updateTopClientsChart() {
clientname = client;
}
- percentage = (data.top_sources[client] / sum) * 100.0;
+ percentage = (data.top_sources[client] / sum) * 100;
clienttable.append(
"
| " +
clientname +
@@ -144,7 +144,7 @@ function updateTopDomainsChart() {
data.top_domains[escapeHtml(domain)] = data.top_domains[domain];
}
- percentage = (data.top_domains[domain] / sum) * 100.0;
+ percentage = (data.top_domains[domain] / sum) * 100;
domaintable.append(
" |
| " +
domain +
@@ -191,7 +191,7 @@ function updateTopAdsChart() {
data.top_ads[escapeHtml(ad)] = data.top_ads[ad];
}
- percentage = (data.top_ads[ad] / sum) * 100.0;
+ percentage = (data.top_ads[ad] / sum) * 100;
adtable.append(
" |
| " +
ad +
diff --git a/scripts/pi-hole/js/db_queries.js b/scripts/pi-hole/js/db_queries.js
index ffe772a6..b0ee076d 100644
--- a/scripts/pi-hole/js/db_queries.js
+++ b/scripts/pi-hole/js/db_queries.js
@@ -209,9 +209,9 @@ var reloadCallback = function () {
$("h3#ads_blocked_exact").text(statistics[2].toLocaleString());
$("h3#ads_wildcard_blocked").text(statistics[3].toLocaleString());
- var percent = 0.0;
+ var percent = 0;
if (statistics[2] + statistics[3] > 0) {
- percent = (100.0 * (statistics[2] + statistics[3])) / statistics[0];
+ percent = (100 * (statistics[2] + statistics[3])) / statistics[0];
}
$("h3#ads_percentage_today").text(parseFloat(percent).toFixed(1).toLocaleString() + " %");
diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js
index a6a383dc..e696b3e7 100644
--- a/scripts/pi-hole/js/index.js
+++ b/scripts/pi-hole/js/index.js
@@ -877,12 +877,12 @@ $(document).ready(function () {
},
label: function (tooltipItems, data) {
if (tooltipItems.datasetIndex === 0) {
- var percentage = 0.0;
+ var percentage = 0;
var permitted = parseInt(data.datasets[1].data[tooltipItems.index]);
var blocked = parseInt(data.datasets[0].data[tooltipItems.index]);
var total = permitted + blocked;
if (total > 0) {
- percentage = (100.0 * blocked) / total;
+ percentage = (100 * blocked) / total;
}
return (
diff --git a/scripts/pi-hole/js/network.js b/scripts/pi-hole/js/network.js
index 51a0282a..58c05ea8 100644
--- a/scripts/pi-hole/js/network.js
+++ b/scripts/pi-hole/js/network.js
@@ -49,9 +49,9 @@ function rgbToHex(values) {
function mixColors(ratio, rgb1, rgb2) {
return [
- (1.0 - ratio) * rgb1[0] + ratio * rgb2[0],
- (1.0 - ratio) * rgb1[1] + ratio * rgb2[1],
- (1.0 - ratio) * rgb1[2] + ratio * rgb2[2]
+ (1 - ratio) * rgb1[0] + ratio * rgb2[0],
+ (1 - ratio) * rgb1[1] + ratio * rgb2[1],
+ (1 - ratio) * rgb1[2] + ratio * rgb2[2]
];
}
|