pict 1.0.159 → 1.0.160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pict.compatible.js +12 -6
- package/dist/pict.compatible.min.js +1 -1
- package/dist/pict.compatible.min.js.map +1 -1
- package/dist/pict.js +12 -6
- package/dist/pict.min.js +2 -2
- package/dist/pict.min.js.map +1 -1
- package/package.json +2 -2
package/dist/pict.compatible.js
CHANGED
|
@@ -950,10 +950,7 @@ return pNumber.toString().replace(this._Regex_formatterAddCommasToNumber,this.pr
|
|
|
950
950
|
*
|
|
951
951
|
* @param {*} pValue
|
|
952
952
|
* @returns {string}
|
|
953
|
-
*/},{key:"formatterDollars",value:function formatterDollars(pValue){if(isNaN(pValue)){return this._Value_NaN_Currency;}if(pValue===null||pValue===undefined){return this._Value_NaN_Currency;}var tmpDollarAmountArbitrary=this.fable.
|
|
954
|
-
if(typeof pValue=='string'){// TODO: Better rounding function? This is a hack to get rid of the currency symbol and commas.
|
|
955
|
-
tmpDollarAmount=parseFloat(pValue.replace(this._Value_MoneySign_Currency,'').replace(this._Regex_formatterDollarsRemoveCommas,'')).toFixed(2);}// If we didn't get a number, return the "not a number" string.
|
|
956
|
-
if(isNaN(tmpDollarAmount)){return this._Value_NaN_Currency;}}// TODO: Get locale data and use that for this stuff.
|
|
953
|
+
*/},{key:"formatterDollars",value:function formatterDollars(pValue,pPrecision,pRoundingMethod){if(isNaN(pValue)){return this._Value_NaN_Currency;}if(pValue===null||pValue===undefined){return this._Value_NaN_Currency;}var tmpDollarAmountArbitrary=this.fable.Math.parsePrecise(pValue);var tmpPrecision=typeof pPrecision=='undefined'?2:pPrecision;var tmpDollarAmount=this.fable.Math.toFixedPrecise(tmpDollarAmountArbitrary,tmpPrecision,pRoundingMethod);// TODO: Get locale data and use that for this stuff.
|
|
957
954
|
return"$".concat(this.formatterAddCommasToNumber(tmpDollarAmount));}/**
|
|
958
955
|
* Round a number to a certain number of digits. If the number is not a number, it will return 0. If no digits are specified, it will default to 2 significant digits.
|
|
959
956
|
*
|
|
@@ -1065,8 +1062,17 @@ return _this21.makeFolderRecursive(tmpParameters,fCallback);}else if(pCreateErro
|
|
|
1065
1062
|
return _this21.makeFolderRecursive(tmpParameters,fCallback);}else{console.log(pCreateError.code);return fCallback(pCreateError);}});}else{return _this21.makeFolderRecursive(tmpParameters,fCallback);}});}}]);}(libFableServiceBase);module.exports=FableServiceFilePersistence;}).call(this);}).call(this,require('_process'));},{"_process":107,"fable-serviceproviderbase":52,"fs":19,"path":101,"readline":19}],67:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');/**
|
|
1066
1063
|
* Arbitrary Precision Math Operations
|
|
1067
1064
|
* @author Steven Velozo <steven@velozo.com>
|
|
1068
|
-
* @description Simple functions that perform arbitrary precision math operations and return string resultant values.
|
|
1069
|
-
*/var FableServiceMath=/*#__PURE__*/function(_libFableServiceBase5){function FableServiceMath(pFable,pOptions,pServiceHash){var _this22;_classCallCheck2(this,FableServiceMath);_this22=_callSuper(this,FableServiceMath,[pFable,pOptions,pServiceHash]);_this22.serviceType='Math';return _this22;}
|
|
1065
|
+
* @description Simple functions that perform arbitrary precision math operations and return string resultant values. Wraps big.js
|
|
1066
|
+
*/var FableServiceMath=/*#__PURE__*/function(_libFableServiceBase5){function FableServiceMath(pFable,pOptions,pServiceHash){var _this22;_classCallCheck2(this,FableServiceMath);_this22=_callSuper(this,FableServiceMath,[pFable,pOptions,pServiceHash]);_this22.serviceType='Math';return _this22;}/*
|
|
1067
|
+
Rounding Methods:
|
|
1068
|
+
|
|
1069
|
+
Property Value BigDecimal Equiv Description
|
|
1070
|
+
---------- ----- ---------------- -----------
|
|
1071
|
+
roundDown 0 ROUND_DOWN Rounds towards zero. (_I.e. truncate, no rounding._)
|
|
1072
|
+
roundHalfUp 1 ROUND_HALF_UP Rounds towards nearest neighbour. (_If equidistant, rounds away from zero._)
|
|
1073
|
+
roundHalfEven 2 ROUND_HALF_EVEN Rounds towards nearest neighbour. (_If equidistant, rounds towards even neighbour._)
|
|
1074
|
+
roundUp 3 ROUND_UP Rounds positively away from zero. (_Always round up._)
|
|
1075
|
+
*/_inherits(FableServiceMath,_libFableServiceBase5);return _createClass2(FableServiceMath,[{key:"roundDown",get:function get(){return this.fable.Utility.bigNumber.roundDown;}},{key:"roundHalfUp",get:function get(){return this.fable.Utility.bigNumber.roundHalfUp;}},{key:"roundHalfEven",get:function get(){return this.fable.Utility.bigNumber.roundHalfEven;}},{key:"roundUp",get:function get(){return this.fable.Utility.bigNumber.roundUp;}},{key:"parsePrecise",value:function parsePrecise(pValue,pNonNumberValue){var tmpNumber;try{tmpNumber=new this.fable.Utility.bigNumber(pValue);}catch(pError){this.log.warn("Error parsing number (type ".concat(_typeof(pValue),"): ").concat(pError));tmpNumber=typeof pNonNumberValue==='undefined'?"0.0":pNonNumberValue;}return tmpNumber.toString();}},{key:"percentagePrecise",value:function percentagePrecise(pIs,pOf){var tmpLeftValue=isNaN(pIs)?0:pIs;var tmpRightValue=isNaN(pOf)?0:pOf;if(tmpRightValue==0){return'0';}var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.div(tmpRightValue);tmpResult=tmpResult.times(100);return tmpResult.toString();}},{key:"roundPrecise",value:function roundPrecise(pValue,pDecimals,pRoundingMethod){var tmpValue=isNaN(pValue)?0:pValue;var tmpDecimals=isNaN(pDecimals)?0:pDecimals;var tmpRoundingMethod=typeof pRoundingMethod==='undefined'?this.roundHalfUp:pRoundingMethod;var tmpArbitraryValue=new this.fable.Utility.bigNumber(tmpValue);var tmpResult=tmpArbitraryValue.round(tmpDecimals,tmpRoundingMethod);return tmpResult.toString();}},{key:"toFixedPrecise",value:function toFixedPrecise(pValue,pDecimals,pRoundingMethod){var tmpValue=isNaN(pValue)?0:pValue;var tmpDecimals=isNaN(pDecimals)?0:pDecimals;var tmpRoundingMethod=typeof pRoundingMethod==='undefined'?this.roundHalfUp:pRoundingMethod;var tmpArbitraryValue=new this.fable.Utility.bigNumber(tmpValue);var tmpResult=tmpArbitraryValue.toFixed(tmpDecimals,tmpRoundingMethod);return tmpResult.toString();}},{key:"addPrecise",value:function addPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.plus(tmpRightValue);return tmpResult.toString();}},{key:"subtractPrecise",value:function subtractPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.minus(tmpRightValue);return tmpResult.toString();}},{key:"multiplyPrecise",value:function multiplyPrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.times(tmpRightValue);return tmpResult.toString();}},{key:"dividePrecise",value:function dividePrecise(pLeftValue,pRightValue){var tmpLeftValue=isNaN(pLeftValue)?0:pLeftValue;var tmpRightValue=isNaN(pRightValue)?0:pRightValue;var tmpLeftArbitraryValue=new this.fable.Utility.bigNumber(tmpLeftValue);var tmpResult=tmpLeftArbitraryValue.div(tmpRightValue);return tmpResult.toString();}}]);}(libFableServiceBase);module.exports=FableServiceMath;},{"fable-serviceproviderbase":52}],68:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');/**
|
|
1070
1076
|
* Precedent Meta-Templating
|
|
1071
1077
|
* @author Steven Velozo <steven@velozo.com>
|
|
1072
1078
|
* @description Process text stream trie and postfix tree, parsing out meta-template expression functions.
|