1/** 2 * Get the symbol from the ISO 4217 currency for the current user. 3 * 4 * @link https://en.wikipedia.org/wiki/ISO_4217#Active_codes 5 * @link https://support.google.com/analytics/answer/9796179?hl=en#zippy=%2Cin-this-article 6 * @returns {string} The ISO currency code for the given symbol or character set. 7 */ 8function currencyToSymbol(symbol) { 9 let currency; 10 symbol = String(symbol).trim().toUpperCase(); 11 switch (symbol) { 12 case '$': 13 case 'usd': 14 case 'USD': 15 currency = '$'; 16 break; 17 case 'zÅ': 18 case 'ZÅ': 19 case 'pln': 20 case 'PLN': 21 currency = 'zÅ'; 22 break; 23 case 'aud': 24 case 'aud$': 25 case 'AUD': 26 case 'AUD$': 27 currency = 'AUD$'; 28 break; 29 case 'â¬': 30 case 'eur': 31 case 'euro': 32 case 'EUR': 33 case 'EURO': 34 currency = 'â¬'; 35 break; 36 case '£': 37 case 'gbp': 38 case 'GBP': 39 default: 40 currency = '£'; 41 break; 42 } 43 44 return currency; 45} 46 47export default currencyToSymbol;
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.