Skip to content

Commit 11d73d4

Browse files
authored
ui: fiat balance
1 parent 13eef9f commit 11d73d4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

BDKSwiftExampleWallet/Model/BalanceDisplayFormat.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import Foundation
99

1010
enum BalanceDisplayFormat: String, CaseIterable, Codable {
11-
case sats = "sats"
1211
case bitcoinSats = "bitcoinSats"
1312
case bitcoin = "btc"
13+
case sats = "sats"
1414
case fiat = "usd"
1515

1616
var displayText: String {

BDKSwiftExampleWallet/View/WalletView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ extension WalletView {
301301
case .bitcoin:
302302
return String(format: "%.8f", Double(viewModel.balanceTotal) / 100_000_000)
303303
case .fiat:
304-
return String(format: "%.2f", viewModel.satsPrice)
304+
return viewModel.satsPrice.formatted(.number.precision(.fractionLength(2)))
305305
}
306306
}
307307

0 commit comments

Comments
 (0)