android:inputType="numberDecimal" private InputFilter lengthFilter = new InputFilter() { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { // source:当前输入的字符 // start:输入字符的开始位置 //
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>floatDecimal.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta htt
/* * @descript: 保留两位小数,如果小数点大于两位小数,就向上取值保留两位小数<br/> * @time 2016-07-13 */function mathCeil(number){ var result = Number(number); text = result.toString(); var pointIndex = text.indexOf("."); if(pointIndex != -1){ var poi