(function($) {

    /**
     * 判断是否都是数字
     * @param str
     */
    $.isDigit = function (str) {
        var patrn = /^\d+$/;
        return patrn.test(str);
    };

    /**
     * 判断是否整形
     * @param str
     */
    $.isInteger = function (str) {
        var patrn = /^([+-]?)(\d+)$/;
        return patrn.test(str);
    };

    /**
     * 判断是否是浮点型
     * @param str
     */
    $.isFloat = function(str) {
        var patrn = /^-?\d+\.?\d*$/;
        return patrn.test(str);
    };

    /**
    * 四舍五入
    * @param number
    * @param fractionDigits
    */
    $.round = function(number,fractionDigits){
       return Math.round(number*Math.pow(10,fractionDigits))/Math.pow(10,fractionDigits);
    }

})(jQuery);
