X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fmodel%2FLedgerTransactionAccount.java;h=c97b7e4a5e7afd801ab73ca4234da776c66753ed;hb=7de6571579a70ab1a74cc703c14e91f3b6136387;hp=28931b8c63d8353fbaa0d26dd15d0ae16054159e;hpb=ee38e21aa7318a51f9f3e62788d920e13b7be620;p=mobile-ledger.git diff --git a/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionAccount.java b/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionAccount.java index 28931b8c..c97b7e4a 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionAccount.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransactionAccount.java @@ -19,6 +19,10 @@ package net.ktnx.mobileledger.model; import androidx.annotation.NonNull; +import net.ktnx.mobileledger.utils.Misc; + +import java.util.Locale; + public class LedgerTransactionAccount { private String accountName; private String shortAccountName; @@ -31,15 +35,15 @@ public class LedgerTransactionAccount { this.setAccountName(accountName); this.amount = amount; this.amountSet = true; - this.currency = currency; - this.comment = comment; + this.currency = Misc.emptyIsNull(currency); + this.comment = Misc.emptyIsNull(comment); } public LedgerTransactionAccount(String accountName) { this.accountName = accountName; } public LedgerTransactionAccount(String accountName, String currency) { this.accountName = accountName; - this.currency = currency; + this.currency = Misc.emptyIsNull(currency); } public LedgerTransactionAccount(LedgerTransactionAccount origin) { // copy constructor @@ -85,7 +89,7 @@ public class LedgerTransactionAccount { return currency; } public void setCurrency(String currency) { - this.currency = currency; + this.currency = Misc.emptyIsNull(currency); } @NonNull public String toString() { @@ -97,8 +101,8 @@ public class LedgerTransactionAccount { sb.append(currency); sb.append(' '); } - sb.append(String.format("%,1.2f", amount)); + sb.append(String.format(Locale.US, "%,1.2f", amount)); return sb.toString(); } -} +} \ No newline at end of file