Keep it tight

This commit is contained in:
shamoon 2024-09-11 18:12:12 -07:00
parent 09320bb71c
commit 1c25d2550b

View File

@ -52,9 +52,8 @@ export default function Component({ service }) {
} }
function toPercent(value, total) { function toPercent(value, total) {
const percentage = (value / total) * 100;
return t("common.percent", { return t("common.percent", {
value: !Number.isNaN(percentage) ? percentage : 0, value: !Number.isNaN(value / total) ? 100 * (value / total) : 0,
maximumFractionDigits: 2, maximumFractionDigits: 2,
}); });
} }