angular-dynamic-number
Advanced tools
Comparing version 2.3.1 to 2.3.2
{ | ||
"name": "angular-dynamic-number", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"homepage": "https://github.com/uhlryk/angular-dynamic-number", | ||
@@ -5,0 +5,0 @@ "authors": [ |
{ | ||
"name": "angular-dynamic-number", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "Highly customizable angular directive for numbers", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -352,2 +352,6 @@ /*jslint node: true */ | ||
function removeDoubledDecimalSeparators (value,parameters) { | ||
return value.replace(new RegExp("[\\" + parameters.fractionSeparator + "]+","g"), parameters.fractionSeparator); | ||
} | ||
function initAllProperties(properties, element, attrs, ngModelController, dynamicNumberStrategy){ | ||
@@ -426,4 +430,4 @@ var strategy = {}; | ||
} | ||
parsedValue = removePrependAppendChars(parsedValue, prepend, append); | ||
parsedValue = removeDoubledDecimalSeparators(parsedValue, parameters); | ||
if(new RegExp('^[\.,'+thousandSeparator+']{2,}').test(parsedValue)) { | ||
@@ -430,0 +434,0 @@ changeViewValue(ngModelController, 0, parameters, state); |
@@ -1,1 +0,1 @@ | ||
!function(n,e){"use strict";if("function"==typeof define&&define.amd)define(["angular"],e);else{if("undefined"==typeof module||"object"!=typeof module.exports)return e(n.angular);module.exports=e(require("angular"))}}(window,function(n){"use strict";function e(n,e,t,r){if(void 0===n||null===n||""===n)return 0;var u="";return u=","===e?String(n).replace(".",","):String(n)}function t(n,e,t){return","===e?String(n).replace(/['\.\s]/g,"").replace(",","."):"."===e?String(n).replace(/[',\s]/g,""):void 0}function r(n,e,t){var r=n;return t&&(r+=t),e&&(r=/^\-.+/.test(r)?r.replace("-","-"+e):/^\-/.test(r)?r:e+r),r}function u(n,e){if(n>=0){var t=parseInt(n,10);if(isNaN(t)===!1&&isFinite(t)&&t>=0)return t}return e}function a(n,e){if(n>=0){var t=parseInt(n,10);if(isNaN(t)===!1&&isFinite(t)&&t>=0)return t}return e}function i(n,e){return","===n?",":"."===n?".":e}function o(n,e){return"false"===n||n===!1?!1:"true"===n||n===!0?!0:e}function c(n,e){return"false"===n||n===!1?!1:"true"===n||n===!0?!0:e}function d(n,e){return"floor"===n?Math.floor:"ceil"===n?Math.ceil:"round"===n?Math.round:e}function m(n,e){return"false"===n||n===!1?!1:"true"===n||n===!0?!0:e}function p(n,e){return"false"===n||n===!1?!1:"true"===n||n===!0?!0:e}function s(n,e,t){if(!n)return t;var r;return r="."===e?new RegExp("^[',\\s]$"):new RegExp("^['\\.\\s]$"),r.test(n)?n:t}function f(n){var e=new RegExp("[^\\d,\\.\\s\\-]{1}");return e.test(n)?n:null}function l(n,e,t,r,u){var a="-?";r===!1&&u===!0?a="-":r===!0&&u===!1&&(a="");var i="[0-9]{0,"+n+"}";0===n&&(i="0");var o="(\\"+t+"([0-9]){0,"+e+"})";return 0===e&&(o=""),new RegExp("^"+a+i+o+"?$")}function g(n){return String(n).replace(/^0+/g,"").replace(/^-0(\d+)/g,"-$1").replace(new RegExp("^-([\\.,\\s])","g"),"-0$1").replace(new RegExp("^[\\.,\\s]","g"),"0$&")}function v(n,e,t){var r=n;return e&&(r=r.replace(new RegExp("[\\"+e+"]","g"),"")),t&&(r=r.replace(new RegExp("[\\"+t+"]","g"),"")),r}function S(n,e){return"."===e?String(n).replace(/\./g,""):","===e?String(n).replace(/,/g,""):String(n).replace(new RegExp("['\\s]","g"),"")}function h(n,e,t){return n=String(n).split(e),n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,t),n.join(e)}function w(n,e){var t=n;if(e.isFixed){var r=t.split(e.fractionSeparator)[1],u=r&&r.length?r.length:0;0===u&&(t+=e.fractionSeparator);for(var a=u;a<e.fractionPart;a++)t+="0"}return t}function x(e,t,u,a,i){i&&(a.enable=!1);var o=String(t),c=w(o,u),d=r(c,u.prepend,u.append),m=n.version;1===m.major&&2===m.minor?e.$viewValue=d:e.$setViewValue(d),e.$render()}function $(n,t,u,a,i,o,c,d,m){if(""===n||void 0===n||null===n)return"";if(n=Number(n),!isNaN(n)&&isFinite(n)){var p=Math.pow(10,t);return n=i?e((a(n*p)/p).toFixed(t),u,d,m):e(String(a(n*p)/p),u,d,m),n=r(n,d,m),o&&(n=h(n,u,c)),n}return i?0..toFixed(t):"0"}function F(n){var e=0;if(document.selection){n.focus();var t=document.selection.createRange();t.moveStart("character",-n.value.length),e=t.text.length}else(n.selectionStart||"0"==n.selectionStart)&&(e="backward"==n.selectionDirection?n.selectionStart:n.selectionEnd);return e}function N(n,e){if(null!==n)if(n.createTextRange){var t=n.createTextRange();t.move("character",e),t.select()}else n.selectionStart?(n.focus(),n.setSelectionRange(e,e)):n.focus()}function P(n,e,t){for(var r=0,u=0,a=0;a<n.length;a++)if(n[a]!==e){if(r++,r>=t)break}else u++;return u}function R(n,e){var t=n,r=t.split(e.fractionSeparator),u=r[0],a=r[1];return a&&a.length>e.fractionPart&&(a=a.slice(0,e.fractionPart),t=[u,a].join(e.fractionSeparator)),t}function T(n){return Number(n)}function b(n,e,t){var r={awnum:n.awnum,numInt:n.numInt,numFract:n.numFract,numSep:n.numSep,numPos:n.numPos,numNeg:n.numNeg,numRound:n.numRound,numThousand:n.numThousand,numThousandSep:n.numThousandSep,numPrepend:n.numPrepend,numAppend:n.numAppend,numFixed:n.numFixed};return e&&(r[e]=t),r}function y(n,e,t,r,g){var v={};n.awnum&&(v=g.getStrategy(n.awnum));var S=u(void 0!==n.numInt?n.numInt:v.numInt,6),h=a(void 0!==n.numFract?n.numFract:v.numFract,2),w=i(void 0!==n.numSep?n.numSep:v.numSep,"."),x=o(void 0!==n.numPos?n.numPos:v.numPos,!0),$=c(void 0!==n.numNeg?n.numNeg:v.numNeg,!0),F=d(void 0!==n.numRound?n.numRound:v.numRound,Math.round),N=p(void 0!==n.numThousand?n.numThousand:v.numThousand,!1),P=s(void 0!==n.numThousandSep?n.numThousandSep:v.numThousandSep,w,"."===w?",":"."),R=f(void 0!==n.numPrepend?n.numPrepend:v.numPrepend),T=f(void 0!==n.numAppend?n.numAppend:v.numAppend),b=m(void 0!==n.numFixed?n.numFixed:v.numFixed,!1);if(x===!1&&$===!1)throw new Error("Number is set to not be positive and not be negative. Change num_pos attr or/and num_neg attr to true");var y=l(S,h,w,x,$);return{element:e,attrs:t,ngModelController:r,viewRegexTest:y,integerPart:S,fractionPart:h,fractionSeparator:w,isPositiveNumber:x,isNegativeNumber:$,roundFunction:F,isThousandSeparator:N,thousandSeparator:P,prepend:R,append:T,isFixed:b}}function E(n,r,u){var a=r.element,i=(r.attrs,r.ngModelController),o=r.viewRegexTest,c=(r.integerPart,r.fractionPart),d=r.fractionSeparator,m=r.isPositiveNumber,p=r.isNegativeNumber,s=(r.roundFunction,r.isThousandSeparator),f=r.thousandSeparator,l=r.prepend,w=r.append,$=(r.isFixed,String(n));if(V){V=!1;var T=new RegExp("[^"+(p?"-":"")+d+f+"0-9]+","g");$=$.replace(T,""),T=new RegExp("^["+d+f+"]"),$=$.replace(T,""),T=new RegExp("["+d+f+"]([0-9]{"+c+"})$"),$=$.replace(T,d+"$1")}if($=v($,l,w),new RegExp("^[.,"+f+"]{2,}").test($))return x(i,0,r,u),0;var b=F(a[0]);l&&b--;var y=$.slice(0,b);y=S(y,f),$=S($,f),y=g(y);var E=$;if($=g($),$==="0"+d&&E===d&&m)return c?(x(i,"0"+d,r,u,!0),N(a[0],2),0):(x(i,"",r,u),0);if(""===$&&"0"===String(n).charAt(0))return x(i,0,r),0;if(void 0===$||""===$)return 0;if("-"===$)return m&&!p?x(i,"",r,u):x(i,"-",r,u),0;if($=R($,r),o.test($)===!1){var A=e(i.$modelValue,d,r);return s&&(A=h(A,d,f)),x(i,A,r,u),N(a[0],b-1),i.$modelValue}var I=0,M=y.length;return s&&($=h($,d,f),I=P($,f,M)),l&&(I++,new RegExp("^(\\-\\d)$").test($)&&(I+=2),new RegExp("^(\\d)$").test($)&&I++),x(i,$,r,u),N(a[0],M+I),t($,d,f)}function A(n,e){n.$setViewValue(""),n.$render(),n.$setViewValue(e),n.$render()}function I(n,e){var t=$(n.$modelValue,e.fractionPart,e.fractionSeparator,e.roundFunction,e.isFixed,e.isThousandSeparator,e.thousandSeparator,e.prepend,e.append);A(n,t)}function M(n){return{restrict:"A",require:"?ngModel",scope:{awnum:"@",numInt:"@",numFract:"@",numSep:"@",numPos:"@",numNeg:"@",numRound:"@",numThousand:"@",numThousandSep:"@",numPrepend:"@",numAppend:"@",numFixed:"@"},link:function(e,t,r,u){if(!t[0]||"INPUT"!==t[0].tagName||"text"!==t[0].type&&"tel"!==t[0].type)return void console.warn("Directive angular-dynamic-number works only for 'input' tag with type = 'text' or type = 'tel'");if(!u)return void console.warn("Directive angular-dynamic-number need ngModel attribute");var a=y(b(e),t,r,u,n);t.on("paste",function(){V=!0}),e.$watch("numInt",function(i,o){o!==i&&(a=y(b(e,"numInt",i),t,r,u,n),I(u,a))}),e.$watch("numFract",function(i,o){o!==i&&(a=y(b(e,"numFract",i),t,r,u,n),I(u,a))}),e.$watch("numSep",function(i,o){o!==i&&(a=y(b(e,"numSep",i),t,r,u,n),I(u,a))}),e.$watch("numPos",function(i,o){o!==i&&(a=y(b(e,"numPos",i),t,r,u,n),I(u,a))}),e.$watch("numNeg",function(i,o){o!==i&&(a=y(b(e,"numNeg",i),t,r,u,n),I(u,a))}),e.$watch("numThousand",function(i,o){o!==i&&(a=y(b(e,"numThousand",i),t,r,u,n),I(u,a))}),e.$watch("numThousandSep",function(i,o){o!==i&&(a=y(b(e,"numThousandSep",i),t,r,u,n),I(u,a))}),e.$watch("numAppend",function(i,o){o!==i&&(a=y(b(e,"numAppend",i),t,r,u,n),I(u,a))}),e.$watch("numPrepend",function(i,o){o!==i&&(a=y(b(e,"numPrepend",i),t,r,u,n),I(u,a))}),e.$watch("numFixed",function(i,o){o!==i&&(a=y(b(e,"numFixed",i),t,r,u,n),I(u,a))});var i={enable:!0,count:0};u.$parsers.unshift(function(n){return i.enable?(i.count++,T(E(n,a,i))):(i.enable=!0,n)}),u.$formatters.push(function(n){return $(n,a.fractionPart,a.fractionSeparator,a.roundFunction,a.isFixed,a.isThousandSeparator,a.thousandSeparator,a.prepend,a.append)})}}}var V=!1,j="dynamicNumber";return n.module(j,[]).provider("dynamicNumberStrategy",function(){var n={};this.addStrategy=function(e,t){n[e]=t},this.getStrategy=function(e){return n[e]},this.$get=function(){return{getStrategy:function(e){return n[e]}}}}).filter("awnum",["dynamicNumberStrategy",function(e){return function(t,r,u,o,c,l,g,v,S){var h,w={};n.isString(r)&&(w=e.getStrategy(r),r=w.numFract);var h=a(r,2),x=i(void 0!==u?u:w.numSep,"."),F=d(void 0!==o?o:w.numRound,Math.round),N=m(void 0!==c?c:w.numFixed,!1),P=p(void 0!==l?l:w.numThousand,!1),R=s(void 0!==g?g:w.numThousandSep,x,"."===x?",":"."),T=f(void 0!==v?v:w.numPrepend),b=f(void 0!==S?S:w.numAppend),y=$(t,h,x,F,N,P,R,T,b);return""===y?"0":y}}]).directive("awnum",["dynamicNumberStrategy",M]),j}); | ||
!function(n,e){"use strict";if("function"==typeof define&&define.amd)define(["angular"],e);else{if("undefined"==typeof module||"object"!=typeof module.exports)return e(n.angular);module.exports=e(require("angular"))}}(window,function(n){"use strict";function e(n,e,t,r){if(void 0===n||null===n||""===n)return 0;var u="";return u=","===e?String(n).replace(".",","):String(n)}function t(n,e,t){return","===e?String(n).replace(/['\.\s]/g,"").replace(",","."):"."===e?String(n).replace(/[',\s]/g,""):void 0}function r(n,e,t){var r=n;return t&&(r+=t),e&&(r=/^\-.+/.test(r)?r.replace("-","-"+e):/^\-/.test(r)?r:e+r),r}function u(n,e){if(n>=0){var t=parseInt(n,10);if(isNaN(t)===!1&&isFinite(t)&&t>=0)return t}return e}function a(n,e){if(n>=0){var t=parseInt(n,10);if(isNaN(t)===!1&&isFinite(t)&&t>=0)return t}return e}function i(n,e){return","===n?",":"."===n?".":e}function o(n,e){return"false"===n||n===!1?!1:"true"===n||n===!0?!0:e}function c(n,e){return"false"===n||n===!1?!1:"true"===n||n===!0?!0:e}function d(n,e){return"floor"===n?Math.floor:"ceil"===n?Math.ceil:"round"===n?Math.round:e}function p(n,e){return"false"===n||n===!1?!1:"true"===n||n===!0?!0:e}function m(n,e){return"false"===n||n===!1?!1:"true"===n||n===!0?!0:e}function s(n,e,t){if(!n)return t;var r;return r="."===e?new RegExp("^[',\\s]$"):new RegExp("^['\\.\\s]$"),r.test(n)?n:t}function f(n){var e=new RegExp("[^\\d,\\.\\s\\-]{1}");return e.test(n)?n:null}function l(n,e,t,r,u){var a="-?";r===!1&&u===!0?a="-":r===!0&&u===!1&&(a="");var i="[0-9]{0,"+n+"}";0===n&&(i="0");var o="(\\"+t+"([0-9]){0,"+e+"})";return 0===e&&(o=""),new RegExp("^"+a+i+o+"?$")}function g(n){return String(n).replace(/^0+/g,"").replace(/^-0(\d+)/g,"-$1").replace(new RegExp("^-([\\.,\\s])","g"),"-0$1").replace(new RegExp("^[\\.,\\s]","g"),"0$&")}function v(n,e,t){var r=n;return e&&(r=r.replace(new RegExp("[\\"+e+"]","g"),"")),t&&(r=r.replace(new RegExp("[\\"+t+"]","g"),"")),r}function S(n,e){return"."===e?String(n).replace(/\./g,""):","===e?String(n).replace(/,/g,""):String(n).replace(new RegExp("['\\s]","g"),"")}function h(n,e,t){return n=String(n).split(e),n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,t),n.join(e)}function w(n,e){var t=n;if(e.isFixed){var r=t.split(e.fractionSeparator)[1],u=r&&r.length?r.length:0;0===u&&(t+=e.fractionSeparator);for(var a=u;a<e.fractionPart;a++)t+="0"}return t}function x(e,t,u,a,i){i&&(a.enable=!1);var o=String(t),c=w(o,u),d=r(c,u.prepend,u.append),p=n.version;1===p.major&&2===p.minor?e.$viewValue=d:e.$setViewValue(d),e.$render()}function $(n,t,u,a,i,o,c,d,p){if(""===n||void 0===n||null===n)return"";if(n=Number(n),!isNaN(n)&&isFinite(n)){var m=Math.pow(10,t);return n=i?e((a(n*m)/m).toFixed(t),u,d,p):e(String(a(n*m)/m),u,d,p),n=r(n,d,p),o&&(n=h(n,u,c)),n}return i?0..toFixed(t):"0"}function F(n){var e=0;if(document.selection){n.focus();var t=document.selection.createRange();t.moveStart("character",-n.value.length),e=t.text.length}else(n.selectionStart||"0"==n.selectionStart)&&(e="backward"==n.selectionDirection?n.selectionStart:n.selectionEnd);return e}function N(n,e){if(null!==n)if(n.createTextRange){var t=n.createTextRange();t.move("character",e),t.select()}else n.selectionStart?(n.focus(),n.setSelectionRange(e,e)):n.focus()}function P(n,e,t){for(var r=0,u=0,a=0;a<n.length;a++)if(n[a]!==e){if(r++,r>=t)break}else u++;return u}function R(n,e){var t=n,r=t.split(e.fractionSeparator),u=r[0],a=r[1];return a&&a.length>e.fractionPart&&(a=a.slice(0,e.fractionPart),t=[u,a].join(e.fractionSeparator)),t}function T(n){return Number(n)}function b(n,e,t){var r={awnum:n.awnum,numInt:n.numInt,numFract:n.numFract,numSep:n.numSep,numPos:n.numPos,numNeg:n.numNeg,numRound:n.numRound,numThousand:n.numThousand,numThousandSep:n.numThousandSep,numPrepend:n.numPrepend,numAppend:n.numAppend,numFixed:n.numFixed};return e&&(r[e]=t),r}function y(n,e){return n.replace(new RegExp("[\\"+e.fractionSeparator+"]+","g"),e.fractionSeparator)}function E(n,e,t,r,g){var v={};n.awnum&&(v=g.getStrategy(n.awnum));var S=u(void 0!==n.numInt?n.numInt:v.numInt,6),h=a(void 0!==n.numFract?n.numFract:v.numFract,2),w=i(void 0!==n.numSep?n.numSep:v.numSep,"."),x=o(void 0!==n.numPos?n.numPos:v.numPos,!0),$=c(void 0!==n.numNeg?n.numNeg:v.numNeg,!0),F=d(void 0!==n.numRound?n.numRound:v.numRound,Math.round),N=m(void 0!==n.numThousand?n.numThousand:v.numThousand,!1),P=s(void 0!==n.numThousandSep?n.numThousandSep:v.numThousandSep,w,"."===w?",":"."),R=f(void 0!==n.numPrepend?n.numPrepend:v.numPrepend),T=f(void 0!==n.numAppend?n.numAppend:v.numAppend),b=p(void 0!==n.numFixed?n.numFixed:v.numFixed,!1);if(x===!1&&$===!1)throw new Error("Number is set to not be positive and not be negative. Change num_pos attr or/and num_neg attr to true");var y=l(S,h,w,x,$);return{element:e,attrs:t,ngModelController:r,viewRegexTest:y,integerPart:S,fractionPart:h,fractionSeparator:w,isPositiveNumber:x,isNegativeNumber:$,roundFunction:F,isThousandSeparator:N,thousandSeparator:P,prepend:R,append:T,isFixed:b}}function A(n,r,u){var a=r.element,i=(r.attrs,r.ngModelController),o=r.viewRegexTest,c=(r.integerPart,r.fractionPart),d=r.fractionSeparator,p=r.isPositiveNumber,m=r.isNegativeNumber,s=(r.roundFunction,r.isThousandSeparator),f=r.thousandSeparator,l=r.prepend,w=r.append,$=(r.isFixed,String(n));if(j){j=!1;var T=new RegExp("[^"+(m?"-":"")+d+f+"0-9]+","g");$=$.replace(T,""),T=new RegExp("^["+d+f+"]"),$=$.replace(T,""),T=new RegExp("["+d+f+"]([0-9]{"+c+"})$"),$=$.replace(T,d+"$1")}if($=v($,l,w),$=y($,r),new RegExp("^[.,"+f+"]{2,}").test($))return x(i,0,r,u),0;var b=F(a[0]);l&&b--;var E=$.slice(0,b);E=S(E,f),$=S($,f),E=g(E);var A=$;if($=g($),$==="0"+d&&A===d&&p)return c?(x(i,"0"+d,r,u,!0),N(a[0],2),0):(x(i,"",r,u),0);if(""===$&&"0"===String(n).charAt(0))return x(i,0,r),0;if(void 0===$||""===$)return 0;if("-"===$)return p&&!m?x(i,"",r,u):x(i,"-",r,u),0;if($=R($,r),o.test($)===!1){var I=e(i.$modelValue,d,r);return s&&(I=h(I,d,f)),x(i,I,r,u),N(a[0],b-1),i.$modelValue}var M=0,V=E.length;return s&&($=h($,d,f),M=P($,f,V)),l&&(M++,new RegExp("^(\\-\\d)$").test($)&&(M+=2),new RegExp("^(\\d)$").test($)&&M++),x(i,$,r,u),N(a[0],V+M),t($,d,f)}function I(n,e){n.$setViewValue(""),n.$render(),n.$setViewValue(e),n.$render()}function M(n,e){var t=$(n.$modelValue,e.fractionPart,e.fractionSeparator,e.roundFunction,e.isFixed,e.isThousandSeparator,e.thousandSeparator,e.prepend,e.append);I(n,t)}function V(n){return{restrict:"A",require:"?ngModel",scope:{awnum:"@",numInt:"@",numFract:"@",numSep:"@",numPos:"@",numNeg:"@",numRound:"@",numThousand:"@",numThousandSep:"@",numPrepend:"@",numAppend:"@",numFixed:"@"},link:function(e,t,r,u){if(!t[0]||"INPUT"!==t[0].tagName||"text"!==t[0].type&&"tel"!==t[0].type)return void console.warn("Directive angular-dynamic-number works only for 'input' tag with type = 'text' or type = 'tel'");if(!u)return void console.warn("Directive angular-dynamic-number need ngModel attribute");var a=E(b(e),t,r,u,n);t.on("paste",function(){j=!0}),e.$watch("numInt",function(i,o){o!==i&&(a=E(b(e,"numInt",i),t,r,u,n),M(u,a))}),e.$watch("numFract",function(i,o){o!==i&&(a=E(b(e,"numFract",i),t,r,u,n),M(u,a))}),e.$watch("numSep",function(i,o){o!==i&&(a=E(b(e,"numSep",i),t,r,u,n),M(u,a))}),e.$watch("numPos",function(i,o){o!==i&&(a=E(b(e,"numPos",i),t,r,u,n),M(u,a))}),e.$watch("numNeg",function(i,o){o!==i&&(a=E(b(e,"numNeg",i),t,r,u,n),M(u,a))}),e.$watch("numThousand",function(i,o){o!==i&&(a=E(b(e,"numThousand",i),t,r,u,n),M(u,a))}),e.$watch("numThousandSep",function(i,o){o!==i&&(a=E(b(e,"numThousandSep",i),t,r,u,n),M(u,a))}),e.$watch("numAppend",function(i,o){o!==i&&(a=E(b(e,"numAppend",i),t,r,u,n),M(u,a))}),e.$watch("numPrepend",function(i,o){o!==i&&(a=E(b(e,"numPrepend",i),t,r,u,n),M(u,a))}),e.$watch("numFixed",function(i,o){o!==i&&(a=E(b(e,"numFixed",i),t,r,u,n),M(u,a))});var i={enable:!0,count:0};u.$parsers.unshift(function(n){return i.enable?(i.count++,T(A(n,a,i))):(i.enable=!0,n)}),u.$formatters.push(function(n){return $(n,a.fractionPart,a.fractionSeparator,a.roundFunction,a.isFixed,a.isThousandSeparator,a.thousandSeparator,a.prepend,a.append)})}}}var j=!1,k="dynamicNumber";return n.module(k,[]).provider("dynamicNumberStrategy",function(){var n={};this.addStrategy=function(e,t){n[e]=t},this.getStrategy=function(e){return n[e]},this.$get=function(){return{getStrategy:function(e){return n[e]}}}}).filter("awnum",["dynamicNumberStrategy",function(e){return function(t,r,u,o,c,l,g,v,S){var h,w={};n.isString(r)&&(w=e.getStrategy(r),r=w.numFract);var h=a(r,2),x=i(void 0!==u?u:w.numSep,"."),F=d(void 0!==o?o:w.numRound,Math.round),N=p(void 0!==c?c:w.numFixed,!1),P=m(void 0!==l?l:w.numThousand,!1),R=s(void 0!==g?g:w.numThousandSep,x,"."===x?",":"."),T=f(void 0!==v?v:w.numPrepend),b=f(void 0!==S?S:w.numAppend),y=$(t,h,x,F,N,P,R,T,b);return""===y?"0":y}}]).directive("awnum",["dynamicNumberStrategy",V]),k}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93880
728