|  | @@ -1,15 +1,14 @@
 | 
												
													
														
															|  |  'use strict';
 |  |  'use strict';
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  /**
 |  |  /**
 | 
												
													
														
															|  | - *
 |  | 
 | 
												
													
														
															|  | 
 |  | + * 1. 必须引用decimal.min.js
 | 
												
													
														
															|  | 
 |  | + * 2. 如果使用ZhCalc.mathCalcExpr和ZhCalc.tranExpr必须引用math.min.js
 | 
												
													
														
															|  |   * @author Mai
 |  |   * @author Mai
 | 
												
													
														
															|  |   * @date
 |  |   * @date
 | 
												
													
														
															|  |   * @version
 |  |   * @version
 | 
												
													
														
															|  |   */
 |  |   */
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -;math.config({
 |  | 
 | 
												
													
														
															|  | -    number: 'BigNumber',
 |  | 
 | 
												
													
														
															|  | -});
 |  | 
 | 
												
													
														
															|  | 
 |  | +;
 | 
												
													
														
															|  |  const zhBaseCalc = (function () {
 |  |  const zhBaseCalc = (function () {
 | 
												
													
														
															|  |      const zeroPrecision = 12, mulPrecision = 12, divPrecision = 12;
 |  |      const zeroPrecision = 12, mulPrecision = 12, divPrecision = 12;
 | 
												
													
														
															|  |  
 |  |  
 | 
												
											
												
													
														
															|  | @@ -71,6 +70,7 @@ const zhBaseCalc = (function () {
 | 
												
													
														
															|  |   * @type {{add, sub, mul, div, round}}
 |  |   * @type {{add, sub, mul, div, round}}
 | 
												
													
														
															|  |   */
 |  |   */
 | 
												
													
														
															|  |  const ZhCalc = (function () {
 |  |  const ZhCalc = (function () {
 | 
												
													
														
															|  | 
 |  | +    let mathConfig = false;
 | 
												
													
														
															|  |      Decimal.set({precision: 50, defaults: true});
 |  |      Decimal.set({precision: 50, defaults: true});
 | 
												
													
														
															|  |      const percentReg = /((\d+)|((\d+)(\.\d+)))%/g;
 |  |      const percentReg = /((\d+)|((\d+)(\.\d+)))%/g;
 | 
												
													
														
															|  |      /**
 |  |      /**
 | 
												
											
												
													
														
															|  | @@ -286,7 +286,16 @@ const ZhCalc = (function () {
 | 
												
													
														
															|  |          },
 |  |          },
 | 
												
													
														
															|  |      };
 |  |      };
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | 
 |  | +    function checkMathConfig () {
 | 
												
													
														
															|  | 
 |  | +        if (!mathConfig) {
 | 
												
													
														
															|  | 
 |  | +            math && math.config({
 | 
												
													
														
															|  | 
 |  | +                number: 'BigNumber',
 | 
												
													
														
															|  | 
 |  | +            });
 | 
												
													
														
															|  | 
 |  | +            mathConfig = true;
 | 
												
													
														
															|  | 
 |  | +        }
 | 
												
													
														
															|  | 
 |  | +    }
 | 
												
													
														
															|  |      function mathCalcExpr(expr) {
 |  |      function mathCalcExpr(expr) {
 | 
												
													
														
															|  | 
 |  | +        checkMathConfig();
 | 
												
													
														
															|  |          return parseFloat(math.evaluate(expr));
 |  |          return parseFloat(math.evaluate(expr));
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  |      function tansExpr(expr) {
 |  |      function tansExpr(expr) {
 |