(function(){SS.entities.Currency=function(a,b,h,i,c,f,g,e,d){this.id=a;this.symbol=b;this.thousandsSeparator=(h||",").replace("&apos;","'");this.decimalSeparator=(i||".").replace("&apos;","'");this.symbolOnLeft=c==null?true:c;this.spaceBetweenAmountAndSymbol=f==null?false:f;this.roundingCoefficient=g||new Number(1/100);this.decimalDigits=e;this.exchangeRates=d||{}};SS.entities.Currency.getCurrencyFromJsonObject=function(c){var b=c.currency,a=new SS.entities.Currency(b.id,b.symbol,b.thousandsSeparator,b.decimalSeparator,b.symbolOnLeft,b.spaceBetweenAmountAndSymbol,b.roundingCoefficient/1000,b.decimalDigits,b.exchangeRates);return a};SS.entities.Currency.prototype={formatPrice:function(h,a,c,l,e){var b="";if(typeof(e)=="undefined"){e=true}if(!l){if(isNaN(h)||h==null||typeof(h)=="undefined"||isNaN(parseFloat(h))){return(h)}}var j=this.symbol||"";var d;if(!l){d=SS.util.roundByCoefficient(h,this.roundingCoefficient);b=SS.util.formatThousands(Math.floor(d))}else{b=h}if(!l){if(a>0){if(this.decimalDigits>=0){a=this.decimalDigits}if(a>0){b+="."+SS.util.pad0(Math.round((d-Math.floor(d))*100)).substring(0,a)}}b=b.replace(/\,/g,"!").replace(/\./g,"#").replace(/\!/g,this.thousandsSeparator).replace(/\#/g,this.decimalSeparator)}var g=(this.spaceBetweenAmountAndSymbol?" ":""),f=0;if(e){for(;f<5;f++){b=b.replace(" ","\u00a0");g=g.replace(" ","\u00a0")}}var k;if(this.symbolOnLeft){k=j+""+g}else{k=g+j}if(k!=""&&c){k='<span class="symbol">'+k+"</span>"}if(this.symbolOnLeft){b=k+b}else{b=b+k}return(b)}}})();
