etMoney.addTextChangedListener(newTextWatcher() {
@Override
public voidbeforeTextChanged(CharSequence s,intstart,intcount,intafter) {
}
@Override
public voidonTextChanged(CharSequence s,intstart,intbefore,intcount) {
}
@Override
public voidafterTextChanged(Editable s) {
String temp = s.toString();
intposDot = temp.indexOf(".");
if(posDot <=0)return;
if(temp.length() - posDot -1>2)
{
s.delete(posDot +3, posDot +4);
}
}
});
网友评论