diff --git a/dydx/dydxFormatter/dydxFormatter/dydxFormatter.swift b/dydx/dydxFormatter/dydxFormatter/dydxFormatter.swift index fa436515..034d2f2f 100644 --- a/dydx/dydxFormatter/dydxFormatter/dydxFormatter.swift +++ b/dydx/dydxFormatter/dydxFormatter/dydxFormatter.swift @@ -229,7 +229,7 @@ public final class dydxFormatter: NSObject, SingletonProtocol { let postfix = ["", "K", "M", "B", "T"] var value = number.decimalValue var index = 0 - while value > 1000.0 && index < (postfix.count - 1) { + while value.magnitude > 1000.0 && index < (postfix.count - 1) { value = value / 1000.0 index += 1 } diff --git a/dydx/dydxPresenters/dydxPresenters/_v4/Vault/Landing/dydxVaultViewBuilder.swift b/dydx/dydxPresenters/dydxPresenters/_v4/Vault/Landing/dydxVaultViewBuilder.swift index 3a5a0258..b58975f8 100644 --- a/dydx/dydxPresenters/dydxPresenters/_v4/Vault/Landing/dydxVaultViewBuilder.swift +++ b/dydx/dydxPresenters/dydxPresenters/_v4/Vault/Landing/dydxVaultViewBuilder.swift @@ -89,7 +89,7 @@ private class dydxVaultViewBuilderPresenter: HostedViewPresenter dydxVaultPositionViewModel? in guard let leverage = position.currentLeverageMultiple?.doubleValue, diff --git a/dydx/dydxViews/dydxViews/_v4/Vault/Landing/dydxVaultPositionView.swift b/dydx/dydxViews/dydxViews/_v4/Vault/Landing/dydxVaultPositionView.swift index 3ada512b..3ad8977b 100644 --- a/dydx/dydxViews/dydxViews/_v4/Vault/Landing/dydxVaultPositionView.swift +++ b/dydx/dydxViews/dydxViews/_v4/Vault/Landing/dydxVaultPositionView.swift @@ -37,8 +37,8 @@ public class dydxVaultPositionViewModel: PlatformViewModel { } fileprivate var notionalValueText: String { - let size = dydxFormatter.shared.condensedDollar(number: notionalValue) ?? "--" - let equity = dydxFormatter.shared.condensedDollar(number: equity) ?? "--" + let size = dydxFormatter.shared.condensedDollar(number: notionalValue, digits: 0) ?? "--" + let equity = dydxFormatter.shared.condensedDollar(number: equity, digits: 0) ?? "--" return "\(size) / \(equity)" } @@ -55,7 +55,7 @@ public class dydxVaultPositionViewModel: PlatformViewModel { } fileprivate var pnlAmountText: String { - dydxFormatter.shared.dollar(number: pnlAmount, digits: 0) ?? "--" + dydxFormatter.shared.condensedDollar(number: pnlAmount, digits: 2) ?? "--" } fileprivate var pnlPercentageText: String {