1/** 2 * dchen 2015-12-02 Jqueryæ©å±ï¼è¾å ¥æ°åæ ¡éªä¸éè¿æ¶ï¼èªå¨éç½®å æ ï¼æ¯å¦è¾å ¥123aæ¶ï¼å½è¾å ¥å®aä¼èªå¨å é¤aï¼å°æ°ä½æ°åç 3 * eqï¼$(this).changeNotFormatebleWord(2) è¾å ¥æ¡è¦æ±ä¿ç两ä½å°æ° 4 */ 5(function($) { 6 jQuery.fn.extend({ 7 "changeNotFormatebleWord" : function(doubleLimit) { 8 9 var input = this.val() + ''; 10 if (input == null || input == '') { 11 return; 12 } 13 // æ¿æ¢ä¸ç¬¦åæ°åè§åçå符ã 14 input = input.replace(/[^\d+(.^\d{1,3})]/g, ''); 15 input = input.replace(new RegExp(',','gm'),'');//æ¿æ¢å ¨é¨, 16 input = input.replace('ã', '.'); 17 // 夿æ¯å¦ä¸ºæææ°åï¼ä¸ºé¶ï¼ä¸éè¿ãååæ°ï¼1.æ¥éä¿¡æ¯ã2.è¾å ¥å¼ã3.å°æ°ç¹åçéå¶ä½æ°ã 18 if (input[0] == '.') { 19 input = '0'; 20 } 21 22 var r = new RegExp("[.]", "gi"); 23 if (input.match(r) != null && input.match(r).length > 1) { 24 input = input.replace(r, ''); 25 } 26 27 if (input < 1 && input > 0) { 28 input = (input + '').replace(/^0+\./g, '0.'); 29 } else if (parseInt(input) == 0 && (input + '').indexOf('.') < 0) { 30 input = 0; 31 } else { 32 input = input.match(/^0+[1-9]+/) ? input = input.replace( 33 /^0+/g, '') : input; 34 } 35 36 var idx = (input + '').indexOf("."); 37 if (idx > 0) { 38 var n = input.length - idx - 1; 39 if (doubleLimit < n) { 40 var e = Math.pow(10, doubleLimit); 41 input = Math.round(input * e) / e; 42 } 43 } 44 if (doubleLimit == 0) { 45 input = parseInt((input + '').replace('.', '')); 46 } 47 // å æ¤å¤æï¼ä¸»è¦æ¯æ¾ç½®å¨æªæ¹åå¼çæé®äºä»¶ä¸éç½®å æ 48 if (input != (this.val() + '')) { 49 this.val(input); 50 } 51 }, 52 // è¾å ¥æ¡ä¸è½å0 53 "notZero" : function() { 54 var input = this.val() + ''; 55 if (input == null || input == '') { 56 return; 57 } 58 if (input == '0'||Number(input)==0) { 59 this.val(''); 60 } 61 }, 62 // è¾å ¥æ¡ä¸è½å0å- 63 "notZeroAndJ" : function() { 64 var input = this.val() + ''; 65 if (input == null || input == '') { 66 return; 67 } 68 if (input == '0'||Number(input)==0) { 69 this.val(''); 70 } 71 if (input == '-') { 72 this.val(''); 73 } 74 }, 75 "notZeroAndHund" : function() { 76 var input = this.val() + ''; 77 if (input == null || input == '') { 78 return; 79 } 80 if (input == '0'||Number(input)==0) { 81 this.val(''); 82 } 83 if (Number(input)>100) { 84 this.val(''); 85 } 86 } 87 }); 88})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.