1{/* <script src="https://cdn.jsdelivr.net/npm/php-unserialize@latest/dist/php-unserialize.min.js"></script> */} 2 3function showprice(amount = 0, thousandseparator = ",") { 4 if (amount == null){ 5 return ""; 6 } 7 if(amount.toString().includes(currency)) { 8 // Price already formatted, don't format 9 return amount; 10 } 11 12 //format amount to 2 decimal places 13 amount = parseFloat(amount).toFixed(2) 14 // Format if over 4 digits separate with a comma 15 // For Canada if in French, the decimal and thousands seperator are the opposite way around - not adding anything to deal with this for websites for the time being. But can be adjusted at a later date if needed, may need to get current language from the session ($_SESSION["selectedlanguage"] or $_SESSION["selectedLanguage"]). 16 amount = amount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, thousandseparator); 17 18 if(BASE_CURRENCY == "EUR") { 19 // Place currency symbol at the end of value with a space between 20 priceFormatted = amount+ " "+CURRENCY_STRING; 21 } else if(BASE_CURRENCY == "GBP" || BASE_CURRENCY == "USD") { 22 // Place currency symbol at the start of value with a no space between 23 priceFormatted = CURRENCY_STRING+amount; 24 } else { 25 // Place currency symbol at the start of value with a space between 26 priceFormatted = CURRENCY_STRING+" "+amount; 27 } 28 29 return priceFormatted; 30} 31 32function translate(text) { 33 34 fetch('/lang-translations.txt') 35 .then(res => res.text()) 36 .then(phpTxt => { 37 const data = PHPUnserialize.unserialize(phpTxt); 38 console.log(data[text].ES) 39 }); 40 41 return text; 42 43} 44 45$(document).on('click', '[data-action="historyBack"]', function (e) { 46 e.preventDefault(); 47 history.back(); 48});
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.