Browse Source

Number.toDecimal

MaiXinRong 8 năm trước cách đây
mục cha
commit
faf200870b
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  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.
  */
+
+Number.prototype.toDecimal = function (ADigit) {
+    return parseFloat(this.toFixed(ADigit));
+};
+
 var  number_util = {
     isNumber : function (obj) {
         return obj === +obj;