From b24297454407f40a55cfca7bb86751d01a400e03 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Sun, 16 Oct 2022 20:53:19 -0600 Subject: [PATCH] Fix amountString formatting for categories and transactions --- Sources/TwigsCore/Category.swift | 2 +- Sources/TwigsCore/Transaction.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/TwigsCore/Category.swift b/Sources/TwigsCore/Category.swift index 143b4be..f523787 100644 --- a/Sources/TwigsCore/Category.swift +++ b/Sources/TwigsCore/Category.swift @@ -38,7 +38,7 @@ extension Category { } public var amountString: String { - return self.amount > 0 ? String(format: "%.02d", Double(self.amount) / 100.0) : "" + return self.amount > 0 ? String(format: "%.02f", Double(self.amount) / 100.0) : "" } } diff --git a/Sources/TwigsCore/Transaction.swift b/Sources/TwigsCore/Transaction.swift index b5bedbf..32a1a13 100644 --- a/Sources/TwigsCore/Transaction.swift +++ b/Sources/TwigsCore/Transaction.swift @@ -56,7 +56,7 @@ extension Transaction { } public var amountString: String { - return self.amount > 0 ? String(format: "%.02d", Double(self.amount) / 100.0) : "" + return self.amount > 0 ? String(format: "%.02f", Double(self.amount) / 100.0) : "" } }