Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- View.OnFocusChangeListener amountOnFocusChangeListener = new View.OnFocusChangeListener() {
- @Override
- public void onFocusChange(View v, boolean hasFocus) {
- if (!hasFocus) {
- rawInput = amount_test.getText().toString();
- Locale dutch = new Locale("nl", "NL");
- NumberFormat numberFormatDutch = NumberFormat.getCurrencyInstance(dutch);
- String formattedAmount = numberFormatDutch.format(new BigDecimal(rawInput));
- amount_test.setText(formattedAmount);
- } else {
- if (rawInput != null) {
- amount_test.setText(rawInput);
- }
- }
- }
- };
- amount_test.setOnFocusChangeListener(amountOnFocusChangeListener);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement