MaiXinRong 8 лет назад
Родитель
Сommit
faf200870b
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      public/web/number_util.js

+ 5 - 0
public/web/number_util.js

@@ -1,6 +1,11 @@
 /**
 /**
  * Created by chen on 2017/7/5.
  * Created by chen on 2017/7/5.
  */
  */
+
+Number.prototype.toDecimal = function (ADigit) {
+    return parseFloat(this.toFixed(ADigit));
+};
+
 var  number_util = {
 var  number_util = {
     isNumber : function (obj) {
     isNumber : function (obj) {
         return obj === +obj;
         return obj === +obj;