diff --git a/wNumb.min.js b/wNumb.min.js index 90fed33..c9cc55c 100644 --- a/wNumb.min.js +++ b/wNumb.min.js @@ -1,4 +1,4 @@ -(function(){function r(b){return b.split("").reverse().join("")}function s(b,f,c){if((b[f]||b[c])&&b[f]===b[c])throw Error(f);}function v(b,f,c,d,e,p,q,k,l,h,n,a){q=a;var m,g=n="";p&&(a=p(a));if("number"!==typeof a||!isFinite(a))return!1;b&&0===parseFloat(a.toFixed(b))&&(a=0);0>a&&(m=!0,a=Math.abs(a));!1!==b&&(p=Math.pow(10,b),a=(Math.round(a*p)/p).toFixed(b));a=a.toString();-1!==a.indexOf(".")&&(b=a.split("."),a=b[0],c&&(n=c+b[1]));f&&(a=r(a).match(/.{1,3}/g),a=r(a.join(r(f))));m&&k&&(g+=k);d&&(g+= -d);m&&l&&(g+=l);g=g+a+n;e&&(g+=e);h&&(g=h(g,q));return g}function w(b,f,c,d,e,h,q,k,l,r,n,a){var m;b="";n&&(a=n(a));if(!a||"string"!==typeof a)return!1;k&&a.substring(0,k.length)===k&&(a=a.replace(k,""),m=!0);d&&a.substring(0,d.length)===d&&(a=a.replace(d,""));l&&a.substring(0,l.length)===l&&(a=a.replace(l,""),m=!0);e&&a.slice(-1*e.length)===e&&(a=a.slice(0,-1*e.length));f&&(a=a.split(f).join(""));c&&(a=a.replace(c,"."));m&&(b+="-");b=Number((b+a).replace(/[^0-9\.\-.]/g,""));q&&(b=q(b));return"number"=== -typeof b&&isFinite(b)?b:!1}function x(b){var f,c,d,e={};for(f=0;fd)e[c]=d;else throw Error(c);else if("encoder"===c||"decoder"===c||"edit"===c||"undo"===c)if("function"===typeof d)e[c]=d;else throw Error(c);else if("string"===typeof d)e[c]=d;else throw Error(c);s(e,"mark","thousand");s(e,"prefix","negative");s(e,"prefix","negativeBefore");return e} -function u(b,f,c){var d,e=[];for(d=0;db&&(l=!0,b=Math.abs(b));!1!==a&&(h=b,b=Math.pow(10,a),b=(Math.round(h*b)/b).toFixed(a));b=b.toString();-1!==b.indexOf(".")?(a=b.split("."),h=a[0],c&&(p=c+a[1])):h=b;e&&(h= +q(h).match(/.{1,3}/g),h=q(h.join(q(e))));l&&m&&(g+=m);d&&(g+=d);l&&n&&(g+=n);g=g+h+p;f&&(g+=f);k&&(g=k(g,u));return g}function x(a,e,c,d,f,h,k,m,n,q,p,b){var l;a="";p&&(b=p(b));if(!b||"string"!==typeof b)return!1;m&&r(b,m)&&(b=b.replace(m,""),l=!0);d&&r(b,d)&&(b=b.replace(d,""));n&&r(b,n)&&(b=b.replace(n,""),l=!0);if(d=f)d=b.slice(-1*f.length)===f;d&&(b=b.slice(0,-1*f.length));e&&(b=b.split(e).join(""));c&&(b=b.replace(c,"."));l&&(a+="-");a=(a+b).replace(/[^0-9\.\-.]/g,"");if(""===a)return!1;a=Number(a); +k&&(a=k(a));return"number"===typeof a&&isFinite(a)?a:!1}function y(a){var e,c,d,f={};for(e=0;ed)f[c]=d;else throw Error(c);else if("encoder"===c||"decoder"===c||"edit"===c||"undo"===c)if("function"===typeof d)f[c]=d;else throw Error(c);else if("string"===typeof d)f[c]=d;else throw Error(c);s(f,"mark","thousand");s(f,"prefix","negative");s(f,"prefix", +"negativeBefore");return f}function v(a,e,c){var d,f=[];for(d=0;d