Fix: pihole `ads_percentage_today` sometimes returned as string (#3313)

pull/3270/head
shamoon 8 months ago committed by GitHub
parent 034f6d29d6
commit 303a62369f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -32,7 +32,7 @@ export default function Component({ service }) {
let blockedValue = `${t("common.number", { value: parseInt(piholeData.ads_blocked_today, 10) })}`;
if (!widget.fields.includes("blocked_percent")) {
blockedValue += ` (${t("common.percent", { value: parseFloat(piholeData.ads_percentage_today.toPrecision(3)) })})`;
blockedValue += ` (${t("common.percent", { value: parseFloat(piholeData.ads_percentage_today).toPrecision(3) })})`;
}
return (
@ -41,7 +41,7 @@ export default function Component({ service }) {
<Block label="pihole.blocked" value={blockedValue} />
<Block
label="pihole.blocked_percent"
value={t("common.percent", { value: parseFloat(piholeData.ads_percentage_today.toPrecision(3)) })}
value={t("common.percent", { value: parseFloat(piholeData.ads_percentage_today).toPrecision(3) })}
/>
<Block
label="pihole.gravity"

Loading…
Cancel
Save