PageSourceSearch

https://silumen.com/cdn/shop/t/43/assets/currency.js?v=47310071450941405631759476913

js silumen.com collected 2026-10-06 19:16:27 UTC 2,000 bytes, 12 lines download raw bytes

1import '@archetype-themes/scripts/config';import '@archetype-themes/scripts/helpers/utils';theme.Currency=(function(){var moneyFormat='${{amount}}';var superScript=theme&&theme.settings&&theme.settings.superScriptPrice;function formatMoney(cents,format){if(!format){format=theme.settings.moneyFormat}
2if(typeof cents==='string'){cents=cents.replace('.','')}
3var value='';var placeholderRegex=/\{\{\s*(\w+)\s*\}\}/;var formatString=(format||moneyFormat);function formatWithDelimiters(number,precision,thousands,decimal){precision=theme.utils.defaultTo(precision,2);thousands=theme.utils.defaultTo(thousands,',');decimal=theme.utils.defaultTo(decimal,'.');if(isNaN(number)||number==null){return 0}
4number=(number/100.0).toFixed(precision);var parts=number.split('.');var dollarsAmount=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,'$1'+thousands);var centsAmount=parts[1]?(decimal+parts[1]):'';return dollarsAmount+centsAmount}
5switch(formatString.match(placeholderRegex)[1]){case 'amount':value=formatWithDelimiters(cents,2);if(superScript&&value&&value.includes('.')){value=value.replace('.','<sup>')+'</sup>'}
6break;case 'amount_no_decimals':value=formatWithDelimiters(cents,0);break;case 'amount_with_comma_separator':value=formatWithDelimiters(cents,2,'.',',');if(superScript&&value&&value.includes(',')){value=value.replace(',','<sup>')+'</sup>'}
7break;case 'amount_no_decimals_with_comma_separator':value=formatWithDelimiters(cents,0,'.',',');break;case 'amount_no_decimals_with_space_separator':value=formatWithDelimiters(cents,0,' ');break}
8return formatString.replace(placeholderRegex,value)}
9function getBaseUnit(variant){if(!variant){return}
10if(!variant.unit_price_measurement||!variant.unit_price_measurement.reference_value){return}
11return variant.unit_price_measurement.reference_value===1?variant.unit_price_measurement.reference_unit:variant.unit_price_measurement.reference_value+variant.unit_price_measurement.reference_unit}
12return{formatMoney:formatMoney,getBaseUnit:getBaseUnit}})()

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.