import androidx.annotation.NonNull;
+import net.ktnx.mobileledger.utils.Misc;
+
+import java.util.Locale;
+
public class LedgerTransactionAccount {
private String accountName;
private String shortAccountName;
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
return currency;
}
public void setCurrency(String currency) {
- this.currency = currency;
+ this.currency = Misc.emptyIsNull(currency);
}
@NonNull
public String toString() {
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