"undefined"==typeof CurrencyUtil&&(CurrencyUtil={}); (function(){CurrencyUtil.roundingMode={};CurrencyUtil.roundingMode.DOWN="DOWN";CurrencyUtil.format=function(a){var b=(new String(a)).replace(/,/g,"").split(".");a=b[0];b=b[1]?"."+b[1]:"";for(var c=/(\d+)(\d{3})/;c.test(a);)a=a.replace(c,"$1,$2");return v=a+b};CurrencyUtil.isNumeric=function(a,b,c){var d=!0,e=0,h="0123456789";b&&(h+=".");c&&(h+="-");for(var g,f=0;f('+b.currencySymbol+a.replace("-","")+")":b.currencySymbol+a};CurrencyUtil.MobileDefaultFormatter=function(a,b){return 0==a.indexOf("-")?"("+b.currencySymbol+a.replace("-","")+")":b.currencySymbol+a};CurrencyUtil.negativeSymbolFormatter=function(a,b){return 0==a.indexOf("-")?''+b.currencySymbol+a+"":b.currencySymbol+a};CurrencyUtil.setting={precision:2, separateSign:",",currencySymbol:"$",formatter:CurrencyUtil.DefaultFormatter,"trailingZeros,":!1};CurrencyUtil.updateSetting=function(a){for(var b in a)if(a.hasOwnProperty(b))if("precision"==b){var c=a[b];0===c%1&&-1c?CurrencyUtil.thousandComma((Math.ceil((c*Math.pow(10, a)).toFixed(1))/Math.pow(10,a)).toFixed(a)):CurrencyUtil.thousandComma((Math.floor((c*Math.pow(10,a)).toFixed(1))/Math.pow(10,a)).toFixed(a)):(a=isNaN(a=Math.abs(a))?2:a,d=void 0==d?",":d,s=0>c.toFixed(a)?"-":"",i=parseInt(c=Math.abs(+c||0).toFixed(a))+"",j=3<(j=i.length)?j%3:0,a=s+(j?i.substr(0,j)+d:"")+i.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+d)+(a?"."+Math.abs(c-i).toFixed(a).slice(2):""));b.trailingZeros&&(a=a.match(/\./)?a.replace(/\.?0*$/,""):a);return b.formatter(a,b)};CurrencyUtil.formatNumberToKM= function(a,b){a=parseFloat(a);if(isNaN(a))return a;let c;if(6==Math.ceil(Math.log10(a+1)))return b.precision=2,b.trailingZeros=!0,c="K",a=Math.floor(a/1E3),CurrencyUtil.formatter(a,b)+c;if(7<=Math.ceil(Math.log10(a+1)))return b.precision=2,b.trailingZeros=!0,c="M",a=Math.floor(a/1E6*100)/100,CurrencyUtil.formatter(a,b)+c;b.precision=0;b.trailingZeros=!1;return CurrencyUtil.formatter(a,b)};CurrencyUtil.thousandComma=function(a){a=a.toString().split(".");for(var b=/(-?\d+)(\d{3})/;b.test(a[0]);)a[0]= a[0].replace(b,"$1,$2");return a[1]?a[0]+"."+a[1]:a[0]};CurrencyUtil.getFormatter=function(a){var b={},c={},d;for(d in CurrencyUtil.setting)c[d]=a.hasOwnProperty(d)?a[d]:CurrencyUtil.setting[d];b.setting=c;b.format=function(e){return CurrencyUtil.formatter(e,b.setting)};return b}})();"undefined"==typeof RateToSGUtils&&(RateToSGUtils={}); (function(){RateToSGUtils.convertRate=function(a,b,c,d){if(a==b)return c;a=d.get(a);b=d.get(b);b=MathUtil.decimal.divide(b,a);return Math.floor(MathUtil.decimal.multiply(c,b))};RateToSGUtils.convertRateForecast=function(a,b,c,d){if(a==b)return c;a=d.get(a);b=d.get(b);b=MathUtil.decimal.divide(b,a);return MathUtil.decimal.multiply(c,b)}})();