Skip to content

A local-first personal finance app

fix: negative numbers in summary report (#5520)

Michael Süssemilchc5f050f6f8bb
diff --git a/packages/desktop-client/src/components/reports/SummaryNumber.tsx b/packages/desktop-client/src/components/reports/SummaryNumber.tsx
index bdbcc6ebb9..a13e8570cd 100644
--- a/packages/desktop-client/src/components/reports/SummaryNumber.tsx
+++ b/packages/desktop-client/src/components/reports/SummaryNumber.tsx
@@ -42,7 +42,7 @@ export function SummaryNumber({
let displayAmount =
contentType === 'percentage'
? format(Math.abs(value), 'number')
- : format(Math.round(value), 'financial');
+ : format(Math.abs(Math.round(value)), 'financial');
displayAmount += suffix;
diff --git a/packages/desktop-client/src/components/reports/reports/Summary.tsx b/packages/desktop-client/src/components/reports/reports/Summary.tsx
index 30edc3648c..b84e16d07f 100644
--- a/packages/desktop-client/src/components/reports/reports/Summary.tsx
+++ b/packages/desktop-client/src/components/reports/reports/Summary.tsx
@@ -466,7 +466,7 @@ function SummaryInner({ widget }: SummaryInnerProps) {
<PrivacyFilter>
{content.type === 'percentage'
? format(Math.abs(data?.total ?? 0), 'number')
- : format(Math.round(data?.total ?? 0), 'financial')}
+ : format(Math.abs(Math.round(data?.total ?? 0)), 'financial')}
{content.type === 'percentage' ? '%' : ''}
</PrivacyFilter>
</View>
diff --git a/upcoming-release-notes/5520.md b/upcoming-release-notes/5520.md
new file mode 100644
index 0000000000..b1590e5ac0
--- /dev/null
+++ b/upcoming-release-notes/5520.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [misu-dev]
+---
+
+Fixes negative numbers shown in the summary report