Guest User

Untitled

a guest
Dec 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. @Override
  2. public boolean onKey(View v, int keyCode, KeyEvent event) {
  3. if(v == et_electricite_€){
  4. if(et_electricite_€.length()>=1){
  5. if (keyCode >= 7 && keyCode <= 16 ) {
  6. et_electricite.setText(String.valueOf(new BigDecimal(Double.parseDouble(et_electricite_€.getText().toString())/tarif).setScale(0, RoundingMode.HALF_UP).intValue()));
  7. return true;
  8.  
  9. }
  10. }
  11.  
  12.  
  13. }
  14.  
  15.  
  16.  
  17. return false;
  18. }
Add Comment
Please, Sign In to add comment