PageSourceSearch

https://sundaygolf.com/cdn/shop/t/466/assets/money-formatting.js?v=92650927623599257641790183541

js sundaygolf.com collected 2026-10-03 22:23:22 UTC 1,929 bytes, 2 lines download raw bytes

1export function convertMoneyToMinorUnits(displayValue,currency="USD"){if(displayValue==null||displayValue==="")return null;const value=String(displayValue).trim();if(value==="")return null;const isZeroDecimal=["BIF","CLP","DJF","GNF","ISK","JPY","KMF","KRW","PYG","RWF","UGX","VND","VUV","XAF","XOF","XPF"].includes(currency.toUpperCase()),cleaned=value.replace(/[^\d.,-]/g,"");if(cleaned==="")return null;let normalized;const lastComma=cleaned.lastIndexOf(","),lastDot=cleaned.lastIndexOf(".");lastComma>lastDot?normalized=cleaned.replace(/\./g,"").replace(",","."):lastDot>lastComma?normalized=cleaned.replace(/,/g,""):normalized=cleaned.replace(/,/g,"");const num=parseFloat(normalized);return isNaN(num)?null:Math.round(isZeroDecimal?num:num*100)}export function formatMoney(minorUnits,format="{{amount}}",currency="USD"){const isZeroDecimal=["BIF","CLP","DJF","GNF","ISK","JPY","KMF","KRW","PYG","RWF","UGX","VND","VUV","XAF","XOF","XPF"].includes(currency.toUpperCase()),value=isZeroDecimal?minorUnits:minorUnits/100,defaultFormattedValue=isZeroDecimal?value.toLocaleString("en-US",{maximumFractionDigits:0}):value.toFixed(2),amountWithCommaSeparator=isZeroDecimal?value.toLocaleString("de-DE",{maximumFractionDigits:0}):value.toLocaleString("de-DE",{minimumFractionDigits:2,maximumFractionDigits:2}),amountNoDecimals=Math.round(value).toLocaleString("en-US"),amountNoDecimalsWithCommaSeparator=Math.round(value).toLocaleString("de-DE");let result=format;return result=result.replace(/\{\{\s*amount_with_comma_separator\s*\}\}/g,amountWithCommaSeparator),result=result.replace(/\{\{\s*amount_no_decimals_with_comma_separator\s*\}\}/g,amountNoDecimalsWithCommaSeparator),result=result.replace(/\{\{\s*amount_no_decimals\s*\}\}/g,amountNoDecimals),result=result.replace(/\{\{\s*amount\s*\}\}/g,defaultFormattedValue),result}
2//# sourceMappingURL=/cdn/shop/t/466/assets/money-formatting.js.map?v=92650927623599257641790183541

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.