diff --git a/v4/common/src/main/java/exchange/dydx/trading/common/formatter/DydxFormatter.kt b/v4/common/src/main/java/exchange/dydx/trading/common/formatter/DydxFormatter.kt index a7b1a325..b3e1c79d 100644 --- a/v4/common/src/main/java/exchange/dydx/trading/common/formatter/DydxFormatter.kt +++ b/v4/common/src/main/java/exchange/dydx/trading/common/formatter/DydxFormatter.kt @@ -267,7 +267,7 @@ class DydxFormatter @Inject constructor() { /* xxxxx.yyyyy */ - fun decimalRaw(number: Double?, digits: Int): String? { + fun decimalLocaleAgnostic(number: Double?, digits: Int): String? { return raw(number = number, digits = digits, locale = Locale.US) } diff --git a/v4/common/src/test/java/exchange/dydx/common/formatter/DydxFormatterTests.kt b/v4/common/src/test/java/exchange/dydx/common/formatter/DydxFormatterTests.kt index 5f5580f7..5e8bc4da 100644 --- a/v4/common/src/test/java/exchange/dydx/common/formatter/DydxFormatterTests.kt +++ b/v4/common/src/test/java/exchange/dydx/common/formatter/DydxFormatterTests.kt @@ -1,7 +1,6 @@ package exchange.dydx.common.formatter import exchange.dydx.trading.common.formatter.DydxFormatter -import junit.framework.TestCase import org.junit.Assert import org.junit.Test import java.time.Instant @@ -214,7 +213,7 @@ class DydxFormatterTests { } @Test - fun testDecimalRaw() { + fun testDecimalLocaleAgnostic() { val formatter = DydxFormatter() data class TestCase( val number: Double, @@ -234,7 +233,7 @@ class DydxFormatterTests { ) testCases.forEach { testCase -> - val formatted = formatter.decimalRaw(number = testCase.number, digits = testCase.digits) + val formatted = formatter.decimalLocaleAgnostic(number = testCase.number, digits = testCase.digits) assert(formatted == testCase.expected) { "Test case: $testCase, formatted: $formatted" } } } diff --git a/v4/feature/workers/src/main/java/exchange/dydx/trading/feature/workers/globalworkers/DydxTransferSubaccountWorker.kt b/v4/feature/workers/src/main/java/exchange/dydx/trading/feature/workers/globalworkers/DydxTransferSubaccountWorker.kt index c84cb1c5..dd26c1ca 100644 --- a/v4/feature/workers/src/main/java/exchange/dydx/trading/feature/workers/globalworkers/DydxTransferSubaccountWorker.kt +++ b/v4/feature/workers/src/main/java/exchange/dydx/trading/feature/workers/globalworkers/DydxTransferSubaccountWorker.kt @@ -48,7 +48,7 @@ class DydxTransferSubaccountWorker( val subaccountNumber: Int = selectedSubaccount?.subaccountNumber ?: 0 val depositAmount = balance?.minus(balanceRetainAmount) ?: 0.0 if (depositAmount <= 0) return@combine - val amountString = formatter.decimalRaw(depositAmount, abacusStateManager.usdcTokenDecimal) + val amountString = formatter.decimalLocaleAgnostic(depositAmount, abacusStateManager.usdcTokenDecimal) ?: return@combine depositToSubaccount(amountString, subaccountNumber, wallet)