From 7837afb4e1898dcb4728f54669f5a73b4320cd57 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 28 Jun 2026 09:18:05 +0200 Subject: [PATCH] Fix phantom UNKNOWN slice caused by floating-point rounding --- .../portfolio-proportion-chart.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts b/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts index bf6fd193e..e24446c34 100644 --- a/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts +++ b/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts @@ -204,8 +204,9 @@ export class GfPortfolioProportionChartComponent const unknownValueInPercentage = new Big(1).minus(totalValueInPercentage); - if (unknownValueInPercentage.gt(0)) { - // If total is below 100%, allocate the remaining percentage to UNKNOWN_KEY + // If total is below 100%, allocate the remaining percentage to UNKNOWN_KEY, + // but ignore negligible remainders to avoid a phantom slice + if (unknownValueInPercentage.gt(0.0001)) { if (chartData[UNKNOWN_KEY]) { chartData[UNKNOWN_KEY].value = chartData[UNKNOWN_KEY].value.plus( unknownValueInPercentage