PageSourceSearch

https://www.decathlon.com/cdn/shop/t/378/assets/money-formatting.js?v=182191346160333327151787069266

js decathlon.com collected 2026-09-24 08:41:28 UTC 2,640 bytes, 2 lines download raw bytes

1const DEFAULT_CURRENCY_DECIMALS=2,CURRENCY_DECIMALS={BHD:3,BIF:0,BYR:0,CLF:4,CLP:0,DJF:0,GNF:0,IQD:3,ISK:0,JOD:3,JPY:0,KMF:0,KRW:0,KWD:3,LYD:3,MRO:5,OMR:3,PYG:0,RWF:0,TND:3,UGX:0,UYI:0,UYW:4,VND:0,VUV:0,XAF:0,XAG:0,XAU:0,XBA:0,XBB:0,XBC:0,XBD:0,XDR:0,XOF:0,XPD:0,XPF:0,XPT:0,XSU:0,XTS:0,XUA:0};export function convertMoneyToMinorUnits(value,currency){const precision=CURRENCY_DECIMALS[currency.toUpperCase()]??2,multiplier=Math.pow(10,precision);if(!value||!value.trim())return null;const parts=value.trim().split(/[^0-9]/).filter(Boolean);if(parts.length===0)return null;const lastPart=parts[parts.length-1]??"",lastPartIsDecimal=precision>0&&parts.length>1&&lastPart.length<=precision;let wholeStr,fractionStr;lastPartIsDecimal?(fractionStr=lastPart,wholeStr=parts.slice(0,-1).join("")):(wholeStr=parts.join(""),fractionStr="");const whole=parseInt(wholeStr,10);if(isNaN(whole))return null;let fraction=0;if(precision>0&&fractionStr){const fractionStrLength=fractionStr.length;fraction=parseInt(fractionStr,10)||0,fraction=fraction*Math.pow(10,precision-fractionStrLength)}return whole*multiplier+fraction}function formatCents(moneyValue,thousandsSeparator,decimalSeparator,precision,divisor){const roundedNumber=(moneyValue/divisor).toFixed(precision);let[a,b]=roundedNumber.split(".");return a||(a="0"),b||(b=""),a=a.replace(/\d(?=(\d\d\d)+(?!\d))/g,digit=>digit+thousandsSeparator),precision<=0?a:a+decimalSeparator+b.padEnd(precision,"0")}export function formatMoney(moneyValue,format,currency){const currencyPrecision=CURRENCY_DECIMALS[currency.toUpperCase()]??2,divisor=Math.pow(10,currencyPrecision);return format.replace(/{{\s*(\w+)\s*}}/g,(_,placeholder)=>{if(typeof placeholder!="string")return"";if(placeholder==="currency")return currency;let thousandsSeparator=",",decimalSeparator=".",precision=currencyPrecision;switch(placeholder){case"amount":break;case"amount_no_decimals":precision=0;break;case"amount_with_comma_separator":thousandsSeparator=".",decimalSeparator=",";break;case"amount_no_decimals_with_comma_separator":thousandsSeparator=".",precision=0;break;case"amount_no_decimals_with_space_separator":thousandsSeparator=" ",precision=0;break;case"amount_with_space_separator":thousandsSeparator=" ",decimalSeparator=",";break;case"amount_with_period_and_space_separator":thousandsSeparator=" ",decimalSeparator=".";break;case"amount_with_apostrophe_separator":thousandsSeparator="'",decimalSeparator=".";break;default:break}return formatCents(moneyValue,thousandsSeparator,decimalSeparator,precision,divisor)})}
2//# sourceMappingURL=/cdn/shop/t/378/assets/money-formatting.js.map?v=182191346160333327151787069266

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.