/*! * accounting.js v0.4.2 * Copyright 2014 Open Exchange Rates * * Freely distributable under the MIT license. * Portions of accounting.js are inspired or borrowed from underscore.js * * Full details and documentation: * http://openexchangerates.github.io/accounting.js/ */ !function(a,b){function c(a){return!!(""===a||a&&a.charCodeAt&&a.substr)}function d(a){return l?l(a):"[object Array]"===m.call(a)}function e(a){return a&&"[object Object]"===m.call(a)}function f(a,b){var c;a=a||{},b=b||{};for(c in b)b.hasOwnProperty(c)&&null==a[c]&&(a[c]=b[c]);return a}function g(a,b,c){var d,e,f=[];if(!a)return f;if(k&&a.map===k)return a.map(b,c);for(d=0,e=a.length;d3?q.length%3:0;return m+(r?q.substr(0,r)+k.thousand:"")+q.substr(r).replace(/(\d{3})(?=\d)/g,"$1"+k.thousand)+(l?k.decimal+o(Math.abs(a),l).split(".")[1]:"")},q=j.formatMoney=function(a,b,c,k,l,m){if(d(a))return g(a,function(a){return q(a,b,c,k,l,m)});a=n(a);var o=f(e(b)?b:{symbol:b,precision:c,thousand:k,decimal:l,format:m},j.settings.currency),r=i(o.format),s=a>0?r.pos:a<0?r.neg:r.zero;return s.replace("%s",o.symbol).replace("%v",p(Math.abs(a),h(o.precision),o.thousand,o.decimal))};j.formatColumn=function(a,b,k,l,m,o){if(!a)return[];var q=f(e(b)?b:{symbol:b,precision:k,thousand:l,decimal:m,format:o},j.settings.currency),r=i(q.format),s=r.pos.indexOf("%s")0?r.pos:a<0?r.neg:r.zero,e=c.replace("%s",q.symbol).replace("%v",p(Math.abs(a),h(q.precision),q.thousand,q.decimal));return e.length>t&&(t=e.length),e});return g(u,function(a,b){return c(a)&&a.length