@OnClick(R.id.tv_add) public void addClick(View view) { double price = getPrice(); double newPrice = BigDecimalUtil.add(price, minPriceUnit); if (TradeUtil.hasDecimals(newPrice)) { priceView.setText(String.valueOf(newPrice)); } else { priceView.setText(String.valueOf((int) newPrice)); } priceView.setSelection(priceView.getText().length()); }
@OnClick(R.id.tv_minus) public void minusClick(View view) { double price = getPrice(); if (price == 0) { return; } double newPrice = BigDecimalUtil.sub(price, minPriceUnit); if (TradeUtil.hasDecimals(newPrice)) { priceView.setText(String.valueOf(newPrice)); } else { priceView.setText(String.valueOf((int) newPrice)); } priceView.setSelection(priceView.getText().length()); }